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 in 1 second.
Content = "0" indicates that the page will jump to the page you want to jump to immediately.
URL is the path to jump
----------------------------------------------
In struts2, it is also very special:
Cause:
Struts2 uses a filter to process requests. By default, it monitors URL address changes.
The following operations are required:
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