Spring MVC settings How to set the default home page

Source: Internet
Author: User


The project uses the SPRINGMVC management request, has a small need, enters the domain name automatically when enters a page (or automatically initiates a request).


1, first think of the way to configure Welcome-file-list in Web. XML, after filling in a restful address here, access to the domain name discovery did not jump to the target page (the method failed)

    < web:welcome-file-list >        < Web:welcome-file >xx/xxx</ Web:welcome-file >    </ web:welcome-file-list >

2, think of is not can configure a @RequestMapping ({"", "Xx/xxx"}), let the corresponding method map empty path, test result is jetty container under can, Tomcat container not.

3, the Final Solution , add the following configuration to the Spring-mvc.xml file to test the problem resolution

<path= "/"  view-name= "redirect:/xx/xxx"/>

Spring MVC settings How to set the default home page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.