J2EE(02) struts-config.xml 配置说明
来源:互联网 发布:沈阳网络营销黑马网络 编辑:程序博客网 时间:2024/05/26 02:51
(1) 在web.xml里面如何配置struts-config.xml 以及多个模块的分开配置
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
//下面就是配置了一个/debug/路径下的访问的请求
<init-param>
<param-name>config/debug</param-name>
<param-value>/WEB-INF/struts-debug-config.xml</param-value>
</init-param>
(2) 一个标准的action的配置
<action-mappings ><action path="/sys" type="com.test.struts.action.SysActionAction" scope="request" parameter="oper" >
<forward name="FW_OK" path="/index.jsp" />
</action>
</action-mappings>
注意:
路径 /sys 前面要斜杠,名称就是今后访问的sys.do, type可以任意指定类路径
如果action继承的是Action,那么里面就要实现execute方法
如果继承的是DispatchAction,那么就任意写方法,参数同于execute方法,xml里面配置时,parameter="oper",表示
函数名放到oper字段里面,一般可以用隐藏域
- J2EE(02) struts-config.xml 配置说明
- struts-config.xml 配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- struts-config.xml配置
- Struts struts-config.xml 配置
- Struts struts-config.xml配置
- Struts-config.xml 详细说明
- [j2ee]struts-config.xml 中的global-forwards
- Lazy Load(1.7.0)中文文档 -- 延迟加载图片的jQuery插件
- Sicily 4481. Prime Factorization
- 2-10 Android Button监听事件的四种方法(三)
- 【Ubuntu手记】Ubuntu11.10下安装Chrome浏览器
- Windows phone 7中的图像控件、资源和样式
- J2EE(02) struts-config.xml 配置说明
- Sicily 4697. Common Subsequence
- Animations的使用(三)
- 有关 Conversion to Dalvik format failed with error 1
- Sicily 4699. 简单哈希
- ubuntu 虚拟机网络设置
- Sicily 4700. 小明与奶牛
- 图像处理基本算法 Hough变换
- Android教程之SQlit数据库操作