2 m0 37663286 m0_37663286 于 2017.08.27 18:49 提问

Struts2 action匹配的问题

struts.xml之前是这么写的 list join delete
分别对应stu-list stu-delete stu-join stu-delete
list和delete都可以找到action
join就找不到action

 <package name="default" namespace="/" extends="struts-default">
        <action name="stu-*" class="studentAction" method="{1}">
            <result name="list">/WEB-INF/views/stu-list.jsp</result>
                <result name="join">/WEB-INF/views/stu-join.jsp</result>
            <result name="delete" type="redirect">/stu-list</result>
        </action>
</package> 

万般无奈,只好改成了如下 倒是能用了 但是我很疑惑为什么找不到action

 <package name="default" namespace="/" extends="struts-default">
        <action name="stu-*" class="studentAction" method="{1}">
            <result name="list">/WEB-INF/views/stu-list.jsp</result>
            <result name="delete" type="redirect">/stu-list</result>
        </action>

        <action name="stu-join" class="studentAction" method="join">
            <result name="join">/WEB-INF/views/stu-join.jsp</result> 
        </action>
</package>

Csdn user default icon
上传中...
上传图片
插入图片