原文地址:http://forum.springside.org.cn/viewthread.php?tid=3404
在struts-plugin.xml中,action的名称的映射是:
<constant name="struts.convention.action.name.lowercase" value="true"/>
<constant name="struts.convention.action.name.separator" value="-"/>
这个是默认的配置,就是去掉Action结尾的单词,把剩余的都转化为小写,然后在中间加上“-”,
例如:
AdminUserAction映射后变成:admin-user.action,这样的映射规则个人感觉很别扭,想用原来的习惯映射成:adminUser.action,
在不改源码的前提下,
只要把strus2-convention-plugin-2.1.6.jar的struts-plugin.xm中的:
<bean type="org.apache.struts2.convention.ActionNameBuilder" class="org.apache.struts2.convention.SEOActionNameBuilder"/>
替换为:
<bean
type="org.apache.struts2.convention.ActionNameBuilder"
class="org.apache.struts2.convention.DefaultActionNameBuilder"/>
就行了。
action的名称映射规则就成了,去掉以Action结尾的,然后把首字母边为小写。
例如:AdminUserAction就映射成了adminUser.action了。
至于那个reuslt的映射,
暂时还没有解决.
分享到:
相关推荐
Struts2插件convention
convention-plugin 插件使用说明
apio2009 convention 试题分析
原文:http://cwiki.apache.org/WW/convention-plugin.html ...无需配置Convention即可使用Convention,Convention的某些约束习惯可以通过配置属性来控制,您也可以在类中覆写其中的方法 来达到扩展目地
struts2-convention-plugin-2.3.32
struts2的convention配置详解 很全
从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...
struts2-convention-plugin-2.3.24.1
Struts2_Convention_Plugin中文文档
中文convention,struts2注解,struts注解,注解实现
struts2-convention-plugin-2.3.15.1.jar
innovus instance 命名规则 Title The Naming Convention for Clock Tree Optimization Repeaters Description Question: When clock tree synthesis or clock tree optimization is run, a lot of buffers with the...
无需配置Convention即可使用Convention,Convention的某些约束习惯可以通过配置属性来控制,您也可以在类中覆写其中的方法来达到扩展目地。
struts2采用convention-plugin实现零配置
从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...
Struts开始使用convention-plugin代替codebehind-plugin来实现struts的零配置,使用Convention插件,你需要此JAR文件
struts2-convention-plugin-2.1.8.jar
struts2-convention-plugin-2.3.32.jar
struts2-convention-plugin-2.1.6.jar