摘要: JSON格式化Date类型 一:实体类中时间字段的GET方法上加上(绿色的部分) private Date createDate; @JsonSerialize(using = CustomDateSerializer.class) public Date getCreateDate() { ret 阅读全文
posted @ 2016-06-27 17:27 Moka<TI 阅读(1862) 评论(0) 推荐(0) 编辑
摘要: myeclipse出现Severs栏不显示Tomcat 【1】:出现如下情况: 【2】在myeclipse的(工作空间)中删除如下的文件即可: 【3】再重启就会出现: 阅读全文
posted @ 2016-06-27 17:25 Moka<TI 阅读(284) 评论(0) 推荐(0) 编辑
摘要: Kaptcha验证码 【1】:引包:kaptcha-2.3.2.jar(版本随意) 【2】:applictionContext.xml中的配置 <!-- 验证码 --> <bean id="captchaProducer" class="com.google.code.kaptcha.impl.De 阅读全文
posted @ 2016-06-27 17:21 Moka<TI 阅读(220) 评论(0) 推荐(0) 编辑
摘要: StringMVC做登录拦截 1:拦截类 package cn.sjt.ums.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; impo 阅读全文
posted @ 2016-06-27 17:17 Moka<TI 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 1:选中你要生成API的整个项目或者几个类,右击选择Export 2:在弹出框里输入javadoc,选择后点击Next 3:编辑存放地址,点击Next 4:可选择jar包,编辑标题,样式等,这里选择默认,点击Next 5:设置编码集,点击Finish 6:如出现 非法字符:\65279,但本身没发现 阅读全文
posted @ 2016-04-28 10:18 Moka<TI 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 工具类:(泛型转化) 【例子】:超类public class GenericDAO<T> { private Class<T> entityClass; protected GenericDAO() { Type type = getClass().getGenericSuperclass(); T 阅读全文
posted @ 2016-04-26 14:40 Moka<TI 阅读(2666) 评论(0) 推荐(1) 编辑
摘要: 一般类上这么写@Transactional(readOnly=true) //配置事务 查询使用 只读public Demo{ //方法的写法 (增删改要写 ReadOnly=false 为可写) @Transactional (propagation=Propagation.REQUIRED,is 阅读全文
posted @ 2016-04-26 14:18 Moka<TI 阅读(3501) 评论(0) 推荐(0) 编辑
摘要: create:表示启动的时候先drop,再create create-drop: 也表示创建,只不过再系统关闭前执行一下drop update: 这个操作启动的时候会去检查schema是否一致,如果不一致会做scheme更新 validate: 启动时验证现有schema与你配置的hibernate 阅读全文
posted @ 2016-04-26 14:13 Moka<TI 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 一:Hibernate 一对一连接表双向关联 1:模型介绍 一个人(Person)对应一个地址(Address)。 2:实体(省略getter、setter方法) public class Person11tab_sx { private int personid; private String n 阅读全文
posted @ 2016-04-26 14:08 Moka<TI 阅读(217) 评论(0) 推荐(0) 编辑
摘要: JS做form表单的验证(不为空) 一:引人css和js 二:在form表单添加属性,input不为空的属性 三:书写JS 四:调用的updateDate()方法部分 阅读全文
posted @ 2016-04-20 17:55 Moka<TI 阅读(909) 评论(0) 推荐(0) 编辑