Changing the default page in a Spring Roo app

To map a default Spring MVC view to a URL, for example to map the default URL, /, add this to your webmvc-config.xml file to define a static view, i.e. a view not using an explicit Controller:

<mvc:view-controller path="/" view-name="index"/>

You can change the view-name attribute to point to any other view if you need to have a default other than /views/index.jspx .

Note that using the web.xml welcome file only works for a real file, and doesn’t work to map to a Spring MVC view URL:

<welcome-file-list><welcome-file>/index</welcome-file></welcome-file-list>

 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.