Action name/url name in debuggers using Struts 2

前端 未结 1 1632
無奈伤痛
無奈伤痛 2020-12-22 09:04

This has been bothering me since I started working with this webapp last year (I had no experience with web development) I don\'t know if this app is structured incorrectly

相关标签:
1条回答
  • 2020-12-22 09:24

    This happens as a result of the bad workflow design. To correct it you should read about PRG pattern. You can change

    <action name="actLogin" class="actionLogin">
        <interceptor-ref name="newStack" />
        <result name="success" type="redirectAction">actHomePage</result>
        <result name="error">Login.jsp</result>
    </action>
    
    <action name="actHomePage" class="actionHomePage">
        <interceptor-ref name="newStack" />
        <result name="success">HomePage.jsp</result>
    </action>
    

    other results are not needed, but you can remain them if you need to forward to a different page with the same action in the URL.

    0 讨论(0)
提交回复
热议问题