近来做了一个小项目,用到了Struts1.x,Spring 2.5和Hibernate3,其中的一些配置文件较为典型,所以拿到这里来和大家分享。
-
<?xmlversion="1.0"encoding="UTF-8"?>
-
<!DOCTYPEstruts-configPUBLIC
- "-//ApacheSoftwareFoundation//DTDStrutsConfiguration1.2//EN"
-
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
-
<struts-config>
-
<form-beans>
-
<form-beanname="userForm"type="org.scorpio.web.form.UserForm"/>
-
<form-beanname="managerForm"type="org.scorpio.web.form.ManagerForm"/>
-
<form-beanname="loginForm"type="org.scorpio.web.form.LoginForm"/>
-
</form-beans>
-
<global-forwards>
-
<forwardname="index"path="/jsp/index.jsp"redirect="true"/>
-
<forwardname="admin"path="/jsp/admin/admin.jsp"/>
-
<forwardname="error"path="/jsp/error.jsp"/>
-
</global-forwards>
-
<action-mappings>
-
<actionpath="/userAction"type="org.springframework.web.struts.DelegatingActionProxy"
-
name="userForm"
-
validate="false"
-
parameter="method"
-
scope="request">
-
<forwardname="register"path="/jsp/register.jsp"/>
-
<forwardname="add"path="/jsp/admin/addUser.jsp"/>
-
<forwardname="success"path="/userAction.do?method=list&page=1&length=8"/>
-
<forwardname="list"path="/jsp/admin/listUser.jsp"/>
-
<forwardname="showUpdate"path="/jsp/admin/updateUser.jsp"/>
-
</action>
-
<actionpath="/managerAction"type="org.springframework.web.struts.DelegatingActionProxy"
-
name="managerForm"
-
validate="false"
-
parameter="method"
-
scope="request">
-
<forwardname="add"path="/jsp/admin/addManager.jsp"/>
-
<forwardname="success"path="/managerAction.do?method=list&page=1&length=8"/>
-
<forwardname="list"path="/jsp/admin/listManager.jsp"/>
-
<forwardname="showUpdate"path="/jsp/admin/updateManager.jsp"/>
-
</action>
-
<actionpath="/loginAction"type="org.springframework.web.struts.DelegatingActionProxy"
-
name="loginForm"
-
input="/jsp/login.jsp"
-
validate="true"
-
scope="request"/>
-
<actionpath="/logoutAction"type="org.scorpio.web.action.LogoutAction"/>
-
</action-mappings>
-
<message-resourcesparameter="applicationResource"/>
-
</struts-config>
分享到:
相关推荐
SSH之Struts1之struts-config.xml常用配置详解(3-21-2008)
SpringMVC相当于SSH框架中struts。 mybatis mybatis是对jdbc的封装,它让数据库底层操作变的透明。mybatis的操作都是围绕一个sqlSessionFactory实例展开的。mybatis通过配置文件关联到各实体类的Mapper文件,...
做ssh架构的时候必要的启动文件,这里设置的非常关键, 一般默认启动的,监听的,页面字符穿,等等都是在这里设置 如果想做ssh的架构可不知道struts-config.xml的, 请到我的资源的struts里面,有详细的例子...
和Spring中OpenSessionInView由于org.springframework.web.struts.ContextLoaderPlugIn中保存同一个对象的名不同导致openSessionInView失效 稍微修改后在struts-config.xml中使用MyContextLoaderPlugIn.jar包中...
Struts框架的总控制器ActionServlet是一个Servlet,在web.xml中配置成自动启动的Servlet,在启动时总控制器会读取配置文件(struts-config.xml)的配置信息,为Struts中不同的模块初始化相应的对象。(面向对象思想) ...
SSH(struts+spring+hibernate)的jar包 SSH 通常指的是 Struts2 做前端控制器,Spring ...配置文件加载顺序为:default.properties -> struts-default.xml -> struts-plugins.xml -> struts.xml -> struts.locale。
application.xml配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=...
Log4j.properties struts-config.xml 非常好用的SSH框架代码生成工具,只要输入数据库表名 数据库密码 数据库用户名。就可以生成SSH框架,非常适合做开发,速度超快,有分页,有SQL语句自动生成,一般的查询 删除 ...
使用myeclipse8.5搭建SSH后,将struts.xml和applicationContext.xml移动到别的地方,示例中为webroot下的config文件夹中,web.xml中需要做的修改示例。其中对于返回上一层方式不同的myeclipse可能不同,如有的用../...
在 struts-config.xml 中定义 <action-mapping>, ActionServlet 会加载。 2 ) spring 负责业务层管理,即 Service (或 Manager). 1 . service 为 action 提供统计的调用接口,封装持久层的 DAO. 2 .可以写...
加入struts的配置文件struts.xml 在web.xml中配置struts <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> <filter-...
<?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-...
整合struts、hibernate、spring的框架,实现实体层和struts-config.xml和spring.xml的分离,比较详细的ssh框架
初全程通过struts-config.xml进行配置动作,配置表单,配置动作以及转发:主要有 ActionForm,Action的书写(Action我建议用Struts的DispathAction,后面在Spring的配置的时候大大减少配置量)和struts-config.xml的配置!...
内含有applicationContext.xml,c3p0-config.xml,c3p0-db.properties,hibernate.cfg.xml,log4j.properties,struts.xml,User.hbm.xml,pom.xml等等配置文件
-- 此处hibernate 的映射 采用的是.xml 配置同则应设置具体配置文件名(*.hbm.xml)</value>--> </list> </property> <!-- 事务配置管理 --> <bean id="transactionManager" class="org.springframework...
主要是三个配置文件 web.xml struts-config.xml applicationContext.xml 数据库是sql2000
用户提交表单时,一个配置好的ActionForm对象被创建,并被填入表单相应的数据,ActionServler根据Struts-config.xml文件配置好的设置决定是否需要表单验证,如果需要就调用ActionForm的Validate()验证后选择将请求...
参考web.xml,struts-config.xml,applicationContext.xml中对应配置,即可明白所谓ioc
2,在struts-config.xml中配置controller(Spring Reference 15.4.1.1. DelegatingRequestProcessor) <!-- 集成Spring --> <set-property property="processorClass" value="org.springframework.web....