It was the problem of the interceptor, the result of the home page, still found the problem.
The company website project inside, is uses index.action as the homepage, accesses the Web-inf inside the HTML file. But I set but not successful, traced in the end, a reason, struts2 more special, struts.xml inside must configure a request and response.
<?XML version= "1.0" encoding= "UTF-8"?><Web-appID= "Webapp_9"version= "3.0"xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd"> <Display-name>Struts Blank</Display-name> <Filter> <Filter-name>Struts2</Filter-name> <Filter-class>Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</Filter-class> </Filter> <filter-mapping> <Filter-name>Struts2</Filter-name> <Url-pattern>/*</Url-pattern> <Dispatcher>REQUEST</Dispatcher> <Dispatcher>FORWARD</Dispatcher> </filter-mapping> <welcome-file-list> <Welcome-file>Index.action</Welcome-file> </welcome-file-list></Web-app>
This makes it easy to use index.action as your home page.
In addition to this configuration, you can also use JSP inside add forward to jump to index.action as the home page. You can also use HTML to add a <meta> tag refresh to jump to the page action inside.
Without request and response, you can only use HTML plus <meta> tags.
Another: Eclipse edit Web. xml, always stuck, because of the problem of the version of the header, the version of the number to be consistent.
<?XML version= "1.0" encoding= "UTF-8"?><Web-appID= "Webapp_9"version= "3.0"xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
Xsi:schemalocation= "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd">
The
, as above, is 3.0.