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

前端 未结 2 1842
旧时难觅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: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.

提交回复
热议问题