Accepted answer

An example of forwarding a request for "/" to a view called "home" in Java:

public class WebConfig extends WebMvcConfigurerAdapter {

  public void addViewControllers(ViewControllerRegistry registry) {


And the same in XML use the element:

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

The above example was copied from the Spring reference docs

Related Query

More Query from same tag