最近研究SSH,发现一个问题,struts2配置文件可以使用通配符,例如:
<struts>
<package name="sshweb" extends="struts-default" namespace="/common">
<action name="*_*" class="{1}" method="{2}" >
<result>/pages/{1}.jsp</result>
<result name="input" >/jsp/{1}.jsp</result>
<result name="C0101001" type="redirectAction">C0101001_execute</result>
<result name="C0101002" type="redirectAction">C0101002_execute</result>
<result name="C0101003" type="redirectAction">C0101003_execute</result>
<result name="C0101004" type="redirectAction">C0101004_execute</result>
<result name="C0101005" type="redirectAction">C0101005_execute</result>
</action>
</package>
</struts>使用通配符,极大的简化了配置文件的设置,但是spring配置文件不知道能不能想struts2那样使用通配符,
否则枯燥的配置文字太多了。有经验的朋友告知一下,谢谢!顺便探讨一下,struts2的返回结果中name属性好像不能使用通配符,要是这也能用通配符,那配置文件简直爽坏了,上百个类只需十几行配置文字就搞定了。
<struts>
<package name="sshweb" extends="struts-default" namespace="/common">
<action name="*_*" class="{1}" method="{2}" >
<result>/pages/{1}.jsp</result>
<result name="input" >/jsp/{1}.jsp</result>
<result name="C0101001" type="redirectAction">C0101001_execute</result>
<result name="C0101002" type="redirectAction">C0101002_execute</result>
<result name="C0101003" type="redirectAction">C0101003_execute</result>
<result name="C0101004" type="redirectAction">C0101004_execute</result>
<result name="C0101005" type="redirectAction">C0101005_execute</result>
</action>
</package>
</struts>使用通配符,极大的简化了配置文件的设置,但是spring配置文件不知道能不能想struts2那样使用通配符,
否则枯燥的配置文字太多了。有经验的朋友告知一下,谢谢!顺便探讨一下,struts2的返回结果中name属性好像不能使用通配符,要是这也能用通配符,那配置文件简直爽坏了,上百个类只需十几行配置文字就搞定了。
解决方案 »
- hibernate实现一一关联报错什么情况
- java.lang.ClassNotFoundException: org.apache.log4j.Category
- 求大虾们帮忙,搞不清这是什么问题
- 一些开源代码:JABB
- Struts2 重复提交问题
- 考试系统的算法
- 用什么调试JSP程序最好
- windows XP 下 hibernate连接sqlserver问题
- TOMCAT能个版本最稳定?适宜做为商用!谢谢!
- ????Only instances of beans with bean-managed transaction demarcation can use getUserTransaction()
- JavaFX 这东西有前途么?
- 关于xml的操作,Java报xml文件不存在的错误 急!
我不要自动装载,就要在spring把struts的重新对应一遍。
唉,spring到底有没有类似通配符的方法啊,不然可能几行的配置代码要重复几百行。