Hi people, I've got the following exception while trying to open the URL http://localhost:8080/app/clientes/agregar:
javax.servlet.ServletException: Could not resolve view with name 'clientes/agregar' in servlet with name 'Spring MVC Dispatcher Servlet'
My mvc-config.xml is the following:
<mvc:annotation-driven />
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
</bean>
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions" value="/WEB-INF/tiles/tiles.xml" />
</bean>
My simple tiles.xml:
<definition name="mainTemplate" template="/WEB-INF/template/template.jsp">
<put-attribute name="titulo" value="Simple Tiles 2 Example" type="string" />
<put-attribute name="header" value="/WEB-INF/template/header.jsp" />
<put-attribute name="footer" value="/WEB-INF/template/footer.jsp" />
</definition>
<definition name="*" extends="mainTemplate">
<put-attribute name="content" value="/WEB-INF/views/{1}.jsp" />
</definition>
When I try to open locations under /app it works fine, like /app/welcome or /app/clientes, but this error appears when trying to open /app/clientes/something. I guess it has something to do with the URL Resolver, but I can't find what...
My ClientesController class, annotated with @Controller has a method like the following:
@RequestMapping(method = RequestMethod.GET, value = "agregar")
public void agregar() { ... }
My JSP view files are located under /WEB-INF/views like:
/WEB-INF/views
-- /clientes
---- agregar.jsp
-- welcome.jsp
-- clientes.jsp
Thanks!