I am using Spring MVC within Tomcat and what I thought was a standard configuration. The web.xml looks like this:
<servlet>
<servlet-name>acme</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/appServlet/acme-spring.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>acme</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Withing the Spring acme-spring.xml, I have the view-controller tag set to the root path:
<mvc:view-controller path="/" view-name="login.jsp"/
and the site resolver tag:
<bean id="siteResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix">
<value>/WEB-INF/views/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
However, when I hit localhost:8080/acme, I would have expected the login.jsp but instead, I receive an Invalid URL error. I took a look at both HTTP Status 404 on Spring 3.1 MVC app and HTTP Status 404 on Spring 3.1 MVC app but there was no joy.
Thoughts on what I have misconfigured?
your tag should be like this
because veiwResolver will take care about the prefix and suffix.