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 ...
随机推荐
- Bootstrap 巨幕页头缩略图和警告框组件
一.巨幕组件 //在固定的范围内,有圆角 <div class="container"> <div class="jumbotron"> ...
- mysql select 练习题
10. 查询Score表中的最高分的学生学号和课程号.(子查询或者排序) select sno,cno from score where degree in(select max(degree) f ...
- hitTest:WithEvent 和Responder Chain
这个方法是找到那个View被touch,当找到后就成为响应链的第一个了,如果他不能处理这个Event,那么就找nextResponder 直至application 如果不能处理,那就会丢弃掉. ht ...
- HIVE中的几种排序
1.order by:全局排序 select * from emp order by sal; 2.sort by:对于每个reduce进行排序 set mapreduce.job.reduces=3 ...
- [LeetCode]题解(python):033-Search in Rotated Sorted Array
题目来源 https://leetcode.com/problems/search-in-rotated-sorted-array/ Suppose a sorted array is rotated ...
- 【上手centos】二、C/C++的编译与运行
尝试了一下运行C/C++程序,觉得最好还是记下来吧,毕竟也算是从不知到已知呢么. 我用sublime写了2个程序,test.c和test.cpp,分别是C程序和C++程序 step1:编译: #gcc ...
- 解决调用context.Session["NAME"]时总出现Object reference not set to an instance of an object.异常的方法
if (context.Session != null) { }
- 【转】github更新自己Fork的代码
github更新自己Fork的代码 时间 2014-03-02 23:25:55 micmiu - 软件开发 原文 http://www.micmiu.com/software/build/git ...
- [代码片段]读取BMP文件(二)
#include <stdio.h> #include <stdlib.h> #pragma pack(2) /*定义WORD为两个字节的类型*/ typedef unsign ...
- textarea 默认文字获取焦点失去焦点
<textarea name="textarea" cols="" title="contactForm" class="t ...