How to remove the action suffix extension in Struts 2
来源:互联网 发布:淘宝达人管理中心地址 编辑:程序博客网 时间:2024/05/22 03:50
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
- Oracle数据库日常维护命令
- 如何在 Laravel 中使用阿里云 OSS
- JSON对象与JSON字符串相互转换
- ios 关于scrollview内空间位置与想象不符的解决办法
- Android Volley完全解析(一),初识Volley的基本用法
- How to remove the action suffix extension in Struts 2
- 【leetcode】ZigZag Conversion【java】
- 最短路径问题2
- Android DiskLruCache完全解析,硬盘缓存的最佳方案
- 文章标题
- jQuery EasyUi实现tab页
- ubuntu解压命令全览
- 【经典算法】:求一个数的因子数
- PAT1033 旧键盘打字