摘要: /** * Created with IntelliJ IDEA. * User: Administrator * Date: 12-8-27 * Time: 下午11:29 * To change this template use File | Settings | File Templates... 阅读全文
posted @ 2014-11-27 17:48 无忧之路 阅读(14648) 评论(1) 推荐(1) 编辑
摘要: 配置文件 service类:package com.zhiguoguo.service;import org.springframework.stereotype.Component;@Componentpublic class HelloService { pu... 阅读全文
posted @ 2014-11-26 14:03 无忧之路 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 如果声明为true,那么在access属性要用hasRole()这样写:如果声明为false(默认),那么access直接就是 阅读全文
posted @ 2014-11-26 11:03 无忧之路 阅读(1439) 评论(0) 推荐(0) 编辑
摘要: Spring Security默认的用户登录表单 页面源代码Login PageLogin with Username and Password User: Password: Remember me on this computer. 阅读全文
posted @ 2014-11-26 10:53 无忧之路 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: public class Test { public static void main(String[] args) { String s = "ni\nhao\nma he yi\nyong"; String[] strs = s.split("\\n| "); ... 阅读全文
posted @ 2014-11-09 19:48 无忧之路 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 在Java中,assert关键字是从JAVA SE 1.4 引入的,为了避免和老版本的Java代码中使用了assert关键字导致错误,Java在执行的时候默认是不启动断言检查的(这个时候,所有的断言语句都将忽略!),如果要开启断言检查,则需要用开关-enableassertions或-ea来开启。a... 阅读全文
posted @ 2014-08-26 19:27 无忧之路 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * 可变参数的方法重载 3 */ 4 class A { 5 public void test(int a, int b) { 6 System.out.println(a+", "+b); 7 } 8 9 public voi... 阅读全文
posted @ 2014-08-25 19:45 无忧之路 阅读(277) 评论(0) 推荐(0) 编辑
摘要: (1)/** * 继承时重写方法的返回类型可以不一样 * 这时的返回值类型必须是与父类相同或者为子类。 */class A { public Object func(){ return null; }}class B extends A { public String... 阅读全文
posted @ 2014-08-25 19:40 无忧之路 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 首先说一句:是版本的问题!在多对多或者多对一,从一中查找多中查询某些语句时容易出现我写的hql为:from Department as d where d.employees.name='Tom';运行时出现异常:org.hibernate.QueryException: illegal attem... 阅读全文
posted @ 2014-08-13 14:47 无忧之路 阅读(1681) 评论(0) 推荐(0) 编辑
摘要: public interface BaseDao { T get(String id); } 1 import java.lang.reflect.ParameterizedType; 2 import java.lang.reflect.Type; 3 4 publi... 阅读全文
posted @ 2014-08-10 22:34 无忧之路 阅读(5853) 评论(0) 推荐(0) 编辑
无忧之路