myeclipse 开发SSH(struts+hibernate+spring)
来源:互联网 发布:国产车遥控编程器 编辑:程序博客网 时间:2024/05/28 09:33
网上有许多相关的文档,参考资料里有详细的说明,这里只是把需注意的地方记录一下:
步骤:struts -----spring ---hibernate
第一步:struts
- public ActionForward execute(ActionMapping mapping, ActionForm form,
- HttpServletRequest request, HttpServletResponse response) {
- LoginForm loginForm = (LoginForm) form;// TODO Auto-generated method stub
- if ( username.equals ( "test" ) && password.equals ("test") ) {
- return mapping.findForward ( "indexForword" );
- } else {
- return mapping.getInputForward();
- }
- }
第二步:spring
注意:spring选择spring1,applicationContext.xml路径需注意下,在src下改为“/WEB-INF/classes/applicationContext.xml”,在web-inf下为"/WEB-INF/applicationContext.xml"
更改type="org.springframework.web.struts.DelegatingActionProxy"
plug-in放在message-resources下面(struts-config)
如有错误,到myeclipse找spring.jar包copy过去。
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
- <struts-config>
- <data-sources />
- <form-beans >
- <form-bean name="loginForm" type="com.dreamity.struts.form.LoginForm" />
- </form-beans>
- <global-exceptions />
- <global-forwards />
- <action-mappings >
- <action
- attribute="loginForm"
- input="/login.jsp"
- name="loginForm"
- path="/login"
- scope="request"
- type="org.springframework.web.struts.DelegatingActionProxy">
- <forward name="failture" path="/login.jsp" />
- <forward name="success" path="/index.jsp" />
- </action>
- </action-mappings>
- <message-resources parameter="com.dreamity.struts.ApplicationResources" />
- <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
- <set-property property="contextConfigLocation" value="/WEB-INF/classes/applicationContext.xml" />
- </plug-in>
- </struts-config>
第三步:hibernate
程序以四层结构来写,结构如附件。
http://p.blog.csdn.net/images/p_blog_csdn_net/bill1315/EntryImages/20081202/截图01.jpg
参考资料:
1,使用myeclipse集成struts,hibernate,spring的一个示例程序 http://www.cnblogs.com/xujiaci/archive/2007/10/11/920597.html
2,MyEclipse开发SSH(Struts+Spring+Hibernate)入门 http://blog.tanggaowei.com/2007/12/myeclipsesshstrutsspringhibernate.html
- myeclipse 开发SSH(struts+hibernate+spring)
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门
- 【SSH】Myeclipse下的Struts+Spring+Hibernate开发实例
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门
- MyEclipse开发SSH(Struts+Spring+Hibernate)入门[转帖]
- Myeclipse开发struts+hibernate+spring小记
- spring + struts + hibernate(ssh)开发记录.
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 用MyEclipse搭建SSH框架 Struts Spring Hibernate
- 怪异ARM指令(%)
- 使用自己的两条腿
- jpgw文件格式说明
- REPLICATE函数
- public、protected、默认、private关键字
- myeclipse 开发SSH(struts+hibernate+spring)
- dataProvider:高级数据绑定
- UUID
- 谋划(25)
- WebServices项目中的角色
- 取生产订单状态的逻辑
- C++模板用法:定义、使用 示例
- JavaScript FAQ(四)——导航功能增强
- C++多线程的创建与使用