struts配置请求后缀,将.action改为.do、.doaction_2015.01.04
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"> <struts>
<!-- 将.action访问,改为.do、.doaction:同时处理这两种后缀 -->
<constant name="struts.action.extension" value="do,doaction"></constant> <package name="hw" namespace="/test" extends="struts-default">
<action name="helloworld" class="com.self.action.HelloWorldAction" method="dohelloworld" >
<result name="doresult">
/showresult.jsp
</result>
</action>
</package>
</struts>
原访问地址:http://localhost:8080/Struts2_01/test/helloworld.action(改后访问404)
该后地址01:http://localhost:8080/Struts2_01/test/helloworld.do
该后地址02:http://localhost:8080/Struts2_01/test/helloworld.doaction
struts配置请求后缀,将.action改为.do、.doaction_2015.01.04的更多相关文章
- 【Struts2学习笔记(4)】指定需要Struts 2请求后缀的常量定义复杂的过程
一.指定需要Struts 2请求后缀处理 我们是在违约前.action后缀访问Action. 事实上默认后缀是通过不断"struts.action.extension"进行更改.例 ...
- struts配置访问后缀为.do,.action,.*
Struts 配置文件的加载顺序 Struts-default.xml---> struts-plugin.xml--> struts.xml--> struts.propert ...
- struts2视频学习笔记 07-08(为Action的属性注入值,指定需要Struts 2处理的请求后缀,常用常量)
课时7 为Action的属性注入值(增加灵活性,适用于经常更改的参数) Struts2为Action中的属性提供了依赖注入功能,在struts2的配置文件中,我们可以很方便地为Action中的属性注入 ...
- struts中的常量,action配置中的默认值
1.struts中Action的开发方式 继承ActionSupport类,这种方法实现的Action可以进行数据校验: 实现Action接口: 不继承任何类,不实现任何接口: 是否继承类或实现接口, ...
- Struts2基础-3 -继承ActionSupport接口创建Action控制器+javaBean接收请求参数+ 默认Action配置处理请求错误 + 使用ActionContext访问ServletAPI
1.目录结构及导入的jar包 2.web.xml 配置 <?xml version="1.0" encoding="UTF-8"?> <web ...
- Struts2 三、指定Struts2处理的请求后缀
Action的请求通常情况下默认为以.action结尾,例如:http://localhost:9000/Struts2/hello/helloAction_sayHello.action .a ...
- Struts2中将.action改为.do
struts2中action的默认拓展名是".action",而之前的拓展名一直为".do",工作中需要要把struts2的action拓展名改为". ...
- Struts配置详解
一.Stuts的元素 1 web.xml 任何一个web应用程序都是基于请求响应模式进行构建的,所以无论采用哪种MVC框架,都离不开web.xml文件的配置.换句话说,web.xml并不是Struts ...
- struts配置中的常量定义
一.常量可以在struts.xml或struts.properties中配置,建议在struts.xml中配置,两种配置方式如下: (1)在struts.xml文件中配置常量 <struts&g ...
随机推荐
- nRF51822之WDT浅析
看门狗定时器 NRF51822 的看门狗定时器是倒计数器, 当计数值减少到 0 时产生 TIMEOUT 事件. 通过 START task 来启动看门狗定时器. 看门狗定时器启动时,如没有其他 32. ...
- docker squid---but git proxy should specify by git config --global http.proxy http:...
Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.t ...
- Qt 之 自定义窗口标题栏(非常完善)
http://blog.csdn.net/goforwardtostep/article/details/53494800
- 安装mssql2008和启动时出现的问题及解决办法
(一) 安装sql server 2008 时, 提示错误:此计算机上安装了 Microsoft Visual Studio 2008 的早期版本. 请在安装 SQL Server 2008 前将 V ...
- MongoDB创建用户
1.在创建用户之前,我们首先应该启动mongodb的用户验证功能,否则建立用户是没有意义的! 2.使用 //这个123用户拥有test1数据库的数据库管理员权限,拥有test2数据库的读取权限 db. ...
- Linux最常用命令及快捷键整理
最近在学Linux系统命令,在阿里云买了一台linux服务器.为方便自己也方便他人,整理了Linux常用命令及快捷键. 用命令: 文件和目录: # cd /home ...
- Mac下安装和配置mongoDB
mac下的mongodb下载安装比较简单,主要有两种方式,一种是下载压缩包解压,另一种是通过npm或者homebrew命令安装,这里就不赘述了, 复杂的在于mongodb运行环境的配置(若未配置运行环 ...
- Selenium2学习-031-WebUI自动化实战实例-029-JavaScript 在 Selenium 自动化中的应用实例之四(获取元素位置和大小)
通过 JS 或 JQuery 获取到元素后,通过 offsetLeft.offsetTop.offsetWidth.offsetHeight 即可获得元素的位置和大小,非常的简单,直接上源码了,敬请参 ...
- 利用Aspose.Word控件实现Word文档的操作
Aspose系列的控件,功能都挺好,之前一直在我的Winform开发框架中用Aspose.Cell来做报表输出,可以实现多样化的报表设计及输出,由于一般输出的内容比较正规化或者多数是表格居多,所以一般 ...
- Java Main Differences between Java and C++
转载自:http://www.cnblogs.com/springfor/p/4036739.html C++ supports pointers whereas Java does not. But ...