In the past few days, the access to the project page is changed to. action access, and a problem occurs when you modify the home page. Modify <welcome-file> index. action </welcome-file> in the web. xml file to this way. When you access the home page, the system reports a 404 error, which means the file cannot be found. There are two solutions for online query.
Method 1: Create an empty index. action file under WebRoot. This method is simple and practical and is strongly recommended.
Method 2: Because the welcome-file must be an existing file, not an action or servlet Path, you can set a goindex such as <welcome-file>. jsp </welcome-file>, and then goindex. jsp write <jsp: forward page = "index. action "/>. This means that a jsp page is used to forward requests to the action.
Method 3: Use META redirection in index.html.
Actions: <META HTTP-EQUIV = "Refresh" CONTENT = "0; URL = max/HelloWorld. action">
Where,
Content = "1 is the time control, indicating that the page to jump is automatically redirected after 1 second. content =" 0 indicates that the page will be redirected to the page you want to jump to immediately.
Url is the path to jump
----------------------------------------------
Cause:
Struts2 uses a filter to process requests. By default, it monitors url address changes.
Step 1:
Modify in web. xml
<Filter-mapping>
<Filter-name> struts2 </filter-name>
<Url-pattern>/* </url-pattern>
<Dispatcher> REQUEST </dispatcher> <dispatcher> FORWARD </dispatcher>
</Filter-mapping>
Step 2:
Add in web. xml
<Welcome-file-list>
<Welcome-file> index. jsp </welcome-file>
</Welcome-file-list>
Step 3:
Homepage jump statement
The content of index. jsp is as follows:
<Jsp: forward page = "HelloWorld. action"> </jsp: forward>
Or use method 3 !!!
From: http://blog.sina.com.cn/s/blog_4b5bc0110100yrn2.html