整合JSF+Spring+Hibernate的小例子
百度广告
package com.zhaoqingjie.service.hibernate;
import java.io.Serializable; public class UserInfo implements Serializable{ } |
|||
@hibernate.class
|
(3)IUserInfoDAO.java
package com.zhaoqingjie.spring.service.dao;
import com.openv.spring.domainmodel.UserInfoVO; public interface IUserInfoDAO extends Serializable{ } |
(4)UserInfoDAO.java
package com.zhaoqingjie.spring.service.dao.impl;
import org.apache.commons.logging.Log; public class UserInfoDAO extends HibernateDaoSupport implements IUserInfoDAO{ |
|||
package com.zhaoqingjie.spring.service; import org.springframework.dao.DataAccessException; public boolean setUserInfo(UserInfoVO userinfoVO) } |
package com.zhaoqingjie.spring.service.impl;
import com.openv.spring.domainmodel.UserInfoVO; import org.apache.commons.logging.Log; import org.springframework.dao.DataAccessException; public class ExampleManagerImpl implements IExampleManager { private IUserInfoDAO userinfo; public ExampleManagerImpl() { public void setUserinfo(IUserInfoDAO userinfoDAO) public boolean setUserInfo(UserInfoVO userinfoVO) |
package com.zhaoqingjie.spring.domainmodel;
import java.io.Serializable; public class UserInfoVO implements Serializable{ |
|||
(8)InfoBean.java
package com.zhaoqingjie.spring.jsf;
import javax.faces.context.FacesContext; import org.apache.commons.logging.Log; import com.openv.spring.domainmodel.UserInfoVO; public class InfoBean { private String username = null; private String email = null; private String response = null; private long maximum = 0; private boolean maximumSet = false; private long minimum = 0; private boolean minimumSet = false; public InfoBean() { public String getEmail() { public void setEmail(String email) { public String submitPersonInfo() { ApplicationContext ac = FacesContextUtils boolean flag = em.setUserInfo(uiVO);
return "success"; return "failure"; public void setResponse(String response) { public String getResponse() { public long getMaximum() { public void setMaximum(long maximum) { public long getMinimum() { public void setMinimum(long minimum) { |
|||
(9)index.jsp
|
(10)home.jsp
用户注册 |
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>