struts2 通配符分隔符问题

*_*这样我知道是可以正常执行下去的,如果name="actionname.*" method="{1}"这样,就完全不行了,就连action类都进不去(我特地写构造函数,发现没执行,根本没生成实例),请问要怎么做才能正常显示。最好是比如<action name="student.*" class="com.oa.StudentAction" method="{1}">
当输入student.add.xhtml这样,就会进入该action的add方法。是不是要通过拦截器?拜谢!

<action name="student.*" class="com.oa.StudentAction" method="{1}">
如果你在struts.xml里这样写的话,
student.add.xhtml这样的请求按理说 应该由它来处理,如果action进不去的话,
可以检查下web.xml里的
<filter-mapping>
<filter-name>struts2Filter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>

你看看 你写的<url-pattern>值是什么,个人认为可能跟它有关系吧
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网