资源简介
SSH+Spring Security+MySQL实现用户登录的权限控制
代码片段和文件信息
package com.anze.ssopro.dao;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.anze.ssopro.model.Userinf;
/**
* A data access object (DAO) providing persistence and search support for
* Userinf entities. Transaction control of the save() update() and delete()
* operations can directly support Spring container-managed transactions or they
* can be augmented to handle user-managed Spring transactions. Each of these
* methods provides additional information for how to configure it for the
* desired type of transaction control.
*
* @see com.anze.ssopro.dao.Userinf
* @author MyEclipse Persistence Tools
*/
public class UserinfDAO extends HibernateDaoSupport {
private static final Log log = LogFactory.getLog(UserinfDAO.class);
// property constants
public static final String UNAME = “uname“;
public static final String UPWD = “upwd“;
protected void initDao() {
// do nothing
}
public void save(Userinf transientInstance) {
log.debug(“saving Userinf instance“);
try {
getHibernateTemplate().save(transientInstance);
log.debug(“save successful“);
} catch (RuntimeException re) {
log.error(“save failed“ re);
throw re;
}
}
public void delete(Userinf persistentInstance) {
log.debug(“deleting Userinf instance“);
try {
getHibernateTemplate().delete(persistentInstance);
log.debug(“delete successful“);
} catch (RuntimeException re) {
log.error(“delete failed“ re);
throw re;
}
}
public Userinf findById(java.lang.String id) {
log.debug(“getting Userinf instance with id: “ + id);
try {
Userinf instance = (Userinf) getHibernateTemplate().get(
“com.anze.ssopro.dao.Userinf“ id);
return instance;
} catch (RuntimeException re) {
log.error(“get failed“ re);
throw re;
}
}
public List findByExample(Userinf instance) {
log.debug(“finding Userinf instance by example“);
try {
List results = getHibernateTemplate().findByExample(instance);
log.debug(“find by example successful result size: “
+ results.size());
return results;
} catch (RuntimeException re) {
log.error(“find by example failed“ re);
throw re;
}
}
public List findByProperty(String propertyName object value) {
log.debug(“finding Userinf instance with property: “ + propertyName
+ “ value: “ + value);
try {
String queryString = “from Userinf as model where model.“
+ propertyName + “= ?“;
return getHibernateTemplate().find(queryString value);
} catch (RuntimeException re) {
log.error(“find by property name failed“ re);
throw re;
}
}
public List findByUname(object uname) {
return findByProperty(UNAME uname);
}
public List findByUpwd(object upwd) {
return findByProperty(UPWD upwd);
}
public List findAll() {
log.debug(“fi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6083 2011-01-19 09:58 SSH+Spring Security成功\SSOPro\.classpath
文件 647 2011-01-19 09:59 SSH+Spring Security成功\SSOPro\.myhibernatedata
文件 291 2011-01-19 16:13 SSH+Spring Security成功\SSOPro\.myme
文件 262 2011-01-19 09:55 SSH+Spring Security成功\SSOPro\.mystrutsdata
文件 1905 2011-01-19 10:29 SSH+Spring Security成功\SSOPro\.project
文件 500 2011-01-19 09:39 SSH+Spring Security成功\SSOPro\.settings\.jsdtscope
文件 330 2011-01-19 09:38 SSH+Spring Security成功\SSOPro\.settings\org.eclipse.jdt.core.prefs
文件 49 2011-01-19 09:39 SSH+Spring Security成功\SSOPro\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2011-01-19 09:39 SSH+Spring Security成功\SSOPro\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 474 2011-01-19 09:58 SSH+Spring Security成功\SSOPro\.springBeans
文件 4239 2011-01-19 09:59 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\dao\UserinfDAO.java
文件 3224 2011-01-19 09:58 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\factory\HibernateSessionFactory.java
文件 1023 2011-01-19 09:53 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\filter\SSOProFilter.java
文件 834 2011-01-19 10:32 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\model\Userinf.hbm.xm
文件 768 2011-01-19 09:59 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\model\Userinf.java
文件 1596 2011-01-19 16:26 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\service\CipherUtil.java
文件 1115 2011-01-19 16:27 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\service\UserinfService.java
文件 1935 2011-01-19 11:25 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\struts\action\UserLoginAction.java
文件 89 2011-01-19 09:55 SSH+Spring Security成功\SSOPro\src\com\anze\ssopro\struts\ApplicationResources.properties
文件 871 2011-01-19 13:47 SSH+Spring Security成功\SSOPro\WebRoot\common\403.htm
文件 36 2011-01-19 09:38 SSH+Spring Security成功\SSOPro\WebRoot\me
文件 350 2011-01-19 17:00 SSH+Spring Security成功\SSOPro\WebRoot\user\admin.jsp
文件 831 2011-01-19 10:45 SSH+Spring Security成功\SSOPro\WebRoot\user\failure.jsp
文件 1622 2011-01-19 16:35 SSH+Spring Security成功\SSOPro\WebRoot\user\include.jsp
文件 2224 2011-01-19 15:00 SSH+Spring Security成功\SSOPro\WebRoot\user\login.jsp
文件 1202 2011-01-19 17:11 SSH+Spring Security成功\SSOPro\WebRoot\user\success.jsp
文件 251 2011-01-19 16:57 SSH+Spring Security成功\SSOPro\WebRoot\user\user.jsp
文件 3203 2011-01-19 10:59 SSH+Spring Security成功\SSOPro\WebRoot\WEB-INF\.struts-config.mex
文件 4641 2011-01-19 16:52 SSH+Spring Security成功\SSOPro\WebRoot\WEB-INF\applicationContext-security.xm
文件 1708 2011-01-19 10:22 SSH+Spring Security成功\SSOPro\WebRoot\WEB-INF\applicationContext.xm
............此处省略114个文件信息
评论
共有 条评论