简体   繁体   中英

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

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

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.

Use this

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM