摘要:
实体更新 Transaction trans=session.beginTransaction(); String hql=”update User user set user.age=20 where user.age=18”; Query queryupdate=session.createQuery(hql); int ret=queryupdate.executeUpdate(); trans.commit(); 实体删除 Transaction trans=session.beginTransaction(); String hql=”delete fr... 阅读全文
摘要:
用拦截器实现登录验证功能AuthorizationInterceptor :packagecom.interceptor;importcom.opensymphony.xwork2.ActionInvocation;importcom.opensymphony.xwork2.interceptor.*;importcom.opensymphony.xwork2.*;importjava.util.*;/***@authorhttp://xp9802.iteye.com/*/publicclassAuthorizationInterceptorextendsAbstractInterceptor 阅读全文