how to set a page in Struts2 to automatically redirect the wrong urls

前端 未结 2 1843
旧时难觅i
旧时难觅i 2021-01-16 19:41

I need to redirect the incorrect URL to my server to a specific page. how can I make that possible?

相关标签:
2条回答
  • 2021-01-16 20:27

    Use this

    <META HTTP-EQUIV="Refresh" CONTENT="0;URL=jsp/login.jsp">
    

    it will automatically redirect to the specified in the url position.

    0 讨论(0)
  • 2021-01-16 20:30

    You can use default action for that in your struts.xml. See http://struts.apache.org/2.x/docs/action-configuration.html#ActionConfiguration-ActionDefault.

    Or there is also Unknown Handlers in Struts2 http://struts.apache.org/2.x/docs/unknown-handlers.html if you need a more complex solution.

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