`
sony-soft
  • 浏览: 1026190 次
文章分类
社区版块
存档分类
最新评论

SSH配置:struts-config.xml

 
阅读更多
近来做了一个小项目,用到了Struts1.x,Spring 2.5和Hibernate3,其中的一些配置文件较为典型,所以拿到这里来和大家分享。
  1. <?xmlversion="1.0"encoding="UTF-8"?>
  2. <!DOCTYPEstruts-configPUBLIC
  3. "-//ApacheSoftwareFoundation//DTDStrutsConfiguration1.2//EN"
  4. "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
  5. <struts-config>
  6. <form-beans>
  7. <form-beanname="userForm"type="org.scorpio.web.form.UserForm"/>
  8. <form-beanname="managerForm"type="org.scorpio.web.form.ManagerForm"/>
  9. <form-beanname="loginForm"type="org.scorpio.web.form.LoginForm"/>
  10. </form-beans>
  11. <global-forwards>
  12. <forwardname="index"path="/jsp/index.jsp"redirect="true"/>
  13. <forwardname="admin"path="/jsp/admin/admin.jsp"/>
  14. <forwardname="error"path="/jsp/error.jsp"/>
  15. </global-forwards>
  16. <action-mappings>
  17. <actionpath="/userAction"type="org.springframework.web.struts.DelegatingActionProxy"
  18. name="userForm"
  19. validate="false"
  20. parameter="method"
  21. scope="request">
  22. <forwardname="register"path="/jsp/register.jsp"/>
  23. <forwardname="add"path="/jsp/admin/addUser.jsp"/>
  24. <forwardname="success"path="/userAction.do?method=list&page=1&length=8"/>
  25. <forwardname="list"path="/jsp/admin/listUser.jsp"/>
  26. <forwardname="showUpdate"path="/jsp/admin/updateUser.jsp"/>
  27. </action>
  28. <actionpath="/managerAction"type="org.springframework.web.struts.DelegatingActionProxy"
  29. name="managerForm"
  30. validate="false"
  31. parameter="method"
  32. scope="request">
  33. <forwardname="add"path="/jsp/admin/addManager.jsp"/>
  34. <forwardname="success"path="/managerAction.do?method=list&page=1&length=8"/>
  35. <forwardname="list"path="/jsp/admin/listManager.jsp"/>
  36. <forwardname="showUpdate"path="/jsp/admin/updateManager.jsp"/>
  37. </action>
  38. <actionpath="/loginAction"type="org.springframework.web.struts.DelegatingActionProxy"
  39. name="loginForm"
  40. input="/jsp/login.jsp"
  41. validate="true"
  42. scope="request"/>
  43. <actionpath="/logoutAction"type="org.scorpio.web.action.LogoutAction"/>
  44. </action-mappings>
  45. <message-resourcesparameter="applicationResource"/>
  46. </struts-config>

分享到:
评论

相关推荐

    SSH之Struts1之struts-config.xml常用配置详解(3-21-2008)

    SSH之Struts1之struts-config.xml常用配置详解(3-21-2008)

    mybatis-config.xml

    SpringMVC相当于SSH框架中struts。  mybatis  mybatis是对jdbc的封装,它让数据库底层操作变的透明。mybatis的操作都是围绕一个sqlSessionFactory实例展开的。mybatis通过配置文件关联到各实体类的Mapper文件,...

    web.xml的配置基于ssh

    做ssh架构的时候必要的启动文件,这里设置的非常关键, 一般默认启动的,监听的,页面字符穿,等等都是在这里设置 如果想做ssh的架构可不知道struts-config.xml的, 请到我的资源的struts里面,有详细的例子...

    MyContextLoaderPlugIn.jar

    和Spring中OpenSessionInView由于org.springframework.web.struts.ContextLoaderPlugIn中保存同一个对象的名不同导致openSessionInView失效 稍微修改后在struts-config.xml中使用MyContextLoaderPlugIn.jar包中...

    JAVA期末大作业课程设计基于SSH框架的管理系统.zip

    Struts框架的总控制器ActionServlet是一个Servlet,在web.xml中配置成自动启动的Servlet,在启动时总控制器会读取配置文件(struts-config.xml)的配置信息,为Struts中不同的模块初始化相应的对象。(面向对象思想) ...

    SSH的jar包.rar

    SSH(struts+spring+hibernate)的jar包 SSH 通常指的是 Struts2 做前端控制器,Spring ...配置文件加载顺序为:default.properties -&gt; struts-default.xml -&gt; struts-plugins.xml -&gt; struts.xml -&gt; struts.locale。

    struts2.3+hibernate3.6+spring3.1整合的纯xml配置的小项目

    application.xml配置 &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=...

    SSH自动生成代码工具加MySQL数据库

    Log4j.properties struts-config.xml 非常好用的SSH框架代码生成工具,只要输入数据库表名 数据库密码 数据库用户名。就可以生成SSH框架,非常适合做开发,速度超快,有分页,有SQL语句自动生成,一般的查询 删除 ...

    struts、applicationContext配置文件移动后web.xml配置示例

    使用myeclipse8.5搭建SSH后,将struts.xml和applicationContext.xml移动到别的地方,示例中为webroot下的config文件夹中,web.xml中需要做的修改示例。其中对于返回上一层方式不同的myeclipse可能不同,如有的用../...

    一个最简单的SSH框架

    在 struts-config.xml 中定义 &lt;action-mapping&gt;, ActionServlet 会加载。 2 ) spring 负责业务层管理,即 Service (或 Manager). 1 . service 为 action 提供统计的调用接口,封装持久层的 DAO. 2 .可以写...

    SSH第7章上机.zip ACCP8.0

    加入struts的配置文件struts.xml 在web.xml中配置struts &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt; &lt;filter-...

    SSH开发纪要整合解决四大问题(中文、jar包冲突、延时加载、模块化)文档

    &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"&gt; &lt;struts-...

    SSH框架Struts/hibernate/spring

    整合struts、hibernate、spring的框架,实现实体层和struts-config.xml和spring.xml的分离,比较详细的ssh框架

    java中SSH框架主要说明SSH各部分的作用

    初全程通过struts-config.xml进行配置动作,配置表单,配置动作以及转发:主要有 ActionForm,Action的书写(Action我建议用Struts的DispathAction,后面在Spring的配置的时候大大减少配置量)和struts-config.xml的配置!...

    Java框架SSH整合的所有配置文件

    内含有applicationContext.xml,c3p0-config.xml,c3p0-db.properties,hibernate.cfg.xml,log4j.properties,struts.xml,User.hbm.xml,pom.xml等等配置文件

    spring3.2+strut2+hibernate4

    -- 此处hibernate 的映射 采用的是.xml 配置同则应设置具体配置文件名(*.hbm.xml)&lt;/value&gt;--&gt; &lt;/list&gt; &lt;/property&gt; &lt;!-- 事务配置管理 --&gt; &lt;bean id="transactionManager" class="org.springframework...

    ssh实现分页功能,一个简单的小项目

    主要是三个配置文件 web.xml struts-config.xml applicationContext.xml 数据库是sql2000

    北京大部分公司的ssh面试题

    用户提交表单时,一个配置好的ActionForm对象被创建,并被填入表单相应的数据,ActionServler根据Struts-config.xml文件配置好的设置决定是否需要表单验证,如果需要就调用ActionForm的Validate()验证后选择将请求...

    ssh框架搭建,供初学者参考

    参考web.xml,struts-config.xml,applicationContext.xml中对应配置,即可明白所谓ioc

    OA项目SSH整合框架

    2,在struts-config.xml中配置controller(Spring Reference 15.4.1.1. DelegatingRequestProcessor) &lt;!-- 集成Spring --&gt; &lt;set-property property="processorClass" value="org.springframework.web....

Global site tag (gtag.js) - Google Analytics