Sto provando a ottenere un primo setup di Spring 3 MVC in esecuzione.Configurazione MVC primaverile di base: PageNotFound utilizzando InternalResourceViewResolver
La mia applicazione è in esecuzione su Tomcat, nel contesto del server di "vite"
Ai fini del test, sto cercando di ottenere le richieste da http://localhost:8080/grapevine/test
a rendere i contenuti di WEB-INF/jsp/noSuchInvitation.jsp
Quando ho provare questo, sto diventando un 404
ei registri suggeriscono che il mio jsp non è presente:
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/grapevine/WEB-INF/jsp/noSuchInvitation.jsp] in DispatcherServlet with name 'grapevine'
devo avere mis-configurate da qualche parte, ma non riesco a vedere quello che ho fatto sbagliato.
Ecco tutti gli snippet rilevanti.
Web.xml:
<servlet>
<servlet-name>grapevine</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>grapevine</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Dal mio contesto:
<mvc:annotation-driven />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
Controller:
@Controller
public class ParticipantInvitationController {
@RequestMapping("/test")
public ModelAndView test()
{
return new ModelAndView("noSuchInvitation");
}
Log:
DEBUG org.springframework.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.JstlView: name 'noSuchInvitation'; URL [/WEB-INF/jsp/noSuchInvitation.jsp]] in DispatcherServlet with name 'grapevine'
DEBUG org.springframework.web.servlet.view.JstlView - Forwarding to resource [/WEB-INF/jsp/noSuchInvitation.jsp] in InternalResourceView 'noSuchInvitation'
DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'grapevine' processing GET request for [/grapevine/WEB-INF/jsp/noSuchInvitation.jsp]
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/grapevine/WEB-INF/jsp/noSuchInvitation.jsp] in DispatcherServlet with name 'grapevine'
DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository - SecurityContext contents are anonymous - context will not be stored in HttpSession.
DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request
Sei sicuro che non ci siano errori di ortografia? –
possibile duplicato di [Nessuna mappatura trovata per richiesta HTTP con URI \ [/WEB-INF/pages/apiForm.jsp \]] (http://stackoverflow.com/questions/1266303/no-mapping-found-for-http -request-with-uri-web-inf-pages-apiform-jsp) – naXa