struts2修改action的后缀名
2011-08-25 16:45
218 查看
struts2 的默认后缀是 .action 虽然很直观,但是很烦琐。很多人喜欢将请求的后缀改为 .do
在struts2中修改action后缀有两种比较简单的办法:
一、在 struts.properties 中修改。
如你想把后缀改为 .do 则
加上一行: struts.action.extension=do
至于加在第几行,应该没有关系,我加在第一行和最后一样都正常。
二、在struts.xml 中修改。
在 struts.xml 中加入一constant 节点:
<constant
name="struts.action.extension" value="do" />
补充:
不知您是否有疑问:如果我两个中都加入了会不会出错,如果不会出错,而且两处配置又不一样,哪个配置优先呢?
这个我实验了一下:如果两处都指定了后缀,也不会出错,且struts.properties 有效。
在struts2中修改action后缀有两种比较简单的办法:
一、在 struts.properties 中修改。
如你想把后缀改为 .do 则
加上一行: struts.action.extension=do
至于加在第几行,应该没有关系,我加在第一行和最后一样都正常。
二、在struts.xml 中修改。
在 struts.xml 中加入一constant 节点:
<constant
name="struts.action.extension" value="do" />
补充:
不知您是否有疑问:如果我两个中都加入了会不会出错,如果不会出错,而且两处配置又不一样,哪个配置优先呢?
这个我实验了一下:如果两处都指定了后缀,也不会出错,且struts.properties 有效。
相关文章推荐
- 修改struts2的.action后缀名
- 修改struts2的.action后缀名
- 修改struts2的action的后缀名
- struts2 修改action的后缀
- Struts2 action的扩展名两种修改方法
- (搜藏)更改struts2的访问后缀名.action为.do或者其他的
- Struts2 Action扩展名的三种修改方法
- Struts2 action的扩展名两种修改方法
- struts2 修改action的后缀
- struts2 修改action的后缀
- Struts2更改action的后缀名
- STRUTS2 ACTION的扩展名修改方法
- Struts2 Action扩展名的修改
- Struts2 Action扩展名的三种修改方法
- 修改Struts2的后缀名
- struts2 修改action的后缀
- Struts2 action的扩展名两种修改方法
- struts2中后缀名.action的更改以及何时该加后缀名,何时不用加
- Struts2 Action扩展名的三种修改方法
- struts2 action 扩展名的修改