How to remove the action suffix extension in Struts 2
来源:互联网 发布:指南针软件诈骗 编辑:程序博客网 时间:2024/05/22 06:24
In Struts 2, all action class has a default suffix .action
extension. For example,
<struts> <package name="default" namespace="/" extends="struts-default"> <action name="SayStruts2"> <result>pages/printStruts2.jsp</result> </action> </package></struts>
To access the “SayStruts2
″ action class, use the following URL :
Action URL : http://localhost:8080/Struts2Example/SayStruts2.action
Configure the action extension
Struts 2 is allow to configure the action extension easily, to change it, just declare a constant “struts.action.extension
” value :
1. html extension
Change the action class to .html
extension.
<struts> <constant name="struts.action.extension" value="html"/> <package name="default" namespace="/" extends="struts-default"> <action name="SayStruts2"> <result>pages/printStruts2.jsp</result> </action> </package></struts>
Now you can access the “SayStruts2
″ action class via
Action URL : http://localhost:8080/Struts2Example/SayStruts2.html
2. No extension
Change the action class to empty extension.
<struts> <constant name="struts.action.extension" value=""/> <package name="default" namespace="/" extends="struts-default"> <action name="SayStruts2"> <result>pages/printStruts2.jsp</result> </action> </package></struts>
Now you can access the “SayStruts2
′ action class via
Action URL : http://localhost:8080/Struts2Example/SayStruts2
0 0
- How to remove the action suffix extension in Struts 2
- How to remove the action suffix extension in Struts 2
- How to remove ^M in the file
- How to get the HttpServletRequest in Struts 2
- How to remove the duplicated value in a String array
- How to remove the component VOB in Components?
- How to remove UCS-2 surrogate pairs in SQL Server?
- Struts 2 in Action
- how to remove submodule in git
- How to remove the VBA Project Password
- How to programmatically remove/hide the system bar in Honeycomb (requires root)
- HOW TO: remove the 300ms delay when clicking on a link in JQuery Mobile
- How to get file extension from string in C++
- how to install vscode with Python extension in ubuntu 16
- how to get the document.referrer @chrome extension development?
- How to install the GeoIP Geo location PECL extension?
- How to config internationalization in struts
- how to remove value in ArrayList in java
- JAVA中的vector,arraylist,linkedlist有什么共同点及区别?
- LR笔试题整理
- [letecode java] Unique Paths
- AIX .tgz的安装包及登录日志查看
- 搭建最简单的SpringMVC框架(使用maven)
- How to remove the action suffix extension in Struts 2
- JS动态添加的属性Form不能提交的问题
- Php move_uploaded_file无法成功
- 换个角度看微软:每年饮料费2300万
- qml学习------------GridLayout
- 结构体struct简介(上)
- 关东升的iOS实战系列图书 《iOS实战:传感器卷(Swift版)》已经上市
- Java程序设计中setFont()函数的用法(转)
- 通过Uid属性控制TextBlock组件的字体颜色