03 2013 档案

摘要:1:反转 inverse inverse="false"的一方控制双方关系,体现在<one-to-many />中的<set><set/>节点的中,多对多关系映射中(默认为fasle) <set inverse="false" ></set><one-to-many class="test.Teacher"> 如果 在<one-to-many>节点中的<set></set>设置了 inverse="true" 阅读全文
posted @ 2013-03-18 20:35 roscee 阅读(120) 评论(0) 推荐(0)
摘要:Configuration cfg = new Configuration().configure();//configure("hibernate.cfg.xml") SessionFactory sf = cfg.buildSessionFactory(); Session ss = sf.openSession(); Transaction ts = ss.beginTransaction(); Query query = ss.createQuery("from Teacher");List list = query.list();.....ts 阅读全文
posted @ 2013-03-11 13:35 roscee 阅读(244) 评论(0) 推荐(0)
摘要:在拦截器中可以三种实现一:继承 AbstractInterceptor 类二:继承MethodFilterInterceptor类三:实现Interceptor 接口在实现Interceptor接口时,会多出init() 和 destroy() 方法拦截器的主体方法是:public String intercept(ActionInvocation arg0) throws Exception {// TODO Auto-generated method stubHttpServletRequest request = ServletActionContext.getRequest(); i. 阅读全文
posted @ 2013-03-01 17:28 roscee 阅读(396) 评论(0) 推荐(0)
摘要:<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>告诉浏览器当前页的编码格式,包括发送的数据格式和接收的数据格式,pageEncoding指定jsp的编写时的编码格式contentType指定最终浏览器上的显示数据编码格式请求为post时req.setCharacterEncoding("utf-8"); resp.setCharacterEncoding("utf-8&q 阅读全文
posted @ 2013-03-01 12:07 roscee 阅读(150) 评论(0) 推荐(0)