I have the following exception when 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 looks like this:
<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 places in / app, it works fine, for example / app / welcome or / app / clientes, but this error appears when trying to open / app / clientes / something. I assume this has something to do with the URL Resolver, but I cannot find that ...
The My ClientesController class annotated with @Controller has the following method:
@RequestMapping(method = RequestMethod.GET, value = "agregar")
public void agregar() { ... }
My JSP view files are located in / WEB -INF / views, for example:
/WEB-INF/views
-- /clientes
-- welcome.jsp
-- clientes.jsp
Thank!