Question about Springmvc default homepage, springmvc default homepage
Springmvc, which was previously written by myself, is a lazy homepage by default:
Default homepage defined in web. xml:
<welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list>
Then jump to the dynamic link of springmvc in index.html.
So there's a http://www.xxx.com/index/home on the address.
The customer does not want/index/home today. Problem: welcome-file-list generally only supports static Web pages. If you have to configure it as the controller URL of SpringMVC, an error is reported.
After checking the information, the solution is as follows:
The following changes are made in web. xml:
<Welcome-file-list> <welcome-file> index </welcome-file> <! -- The index has no suffix --> </welcome-file-list> <servlet-mapping> <! -- The Servlet name is myproject-dispatcher, which can have multiple dispatcherservlets, which are distinguished by names. Each DispatcherServlet has its own WebApplicationContext context object. Save it to the ServletContext and Request object at the same time --> <servlet-name> myproject-dispatcher </servlet-name> <! -- Intercept the request at the end of *. do. --> <Url-pattern>/</url-pattern> </servlet-mapping> <servlet-name> myproject-dispatcher </servlet-name> <url-pattern>/index </url-pattern> </servlet-mapping>
Note: welcome-file-list is configured with no/index. The SpringMVC controller is registered with A/index URL (this includes "/").
Java enterprise-level general permission security framework source code SpringMVC mybatis or hibernate + ehcache shiro druid bootstrap HTML5
[Download java framework source code]