在我的应用程序中,我们像这样使用它:
<action name="*/*" class="{1}Action" method="{2}">
<interceptor-ref name="CustomAuthStack" />
<result>/pages/{1}/{2}.jsp</result>
<result name="input">/pages/error/denied.jsp</result>
<result name="logout">/pages/error/denied.jsp</result>
<!-- methods that come back to listing after processing -->
<result name="remove" type="redirectAction">{1}/list</result>
<result name="save" type="redirectAction">{1}/list</result>
<result name="enable" type="redirectAction">{1}/list</result>
....
</action>
对于像 myapp/users/list 这样的斜杠,您必须使用
<constant name="struts.enable.SlashesInActionNames" value="true" />
在 strus.xml 中。
所以现在你有了一个标准:
action --> UserAction jsp -----> users/list.jsp
等等