There is no stacktrace. Just WARN message in log:
19:00:45.045 WARN [qtp1828132740-20] org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/WEB-INF/pages/main-page.jsp]
in DispatcherServlet with name 'org.springframework.web.servlet.DispatcherServlet-840703178'
See
https://gist.github.com/azhuchkov/68288f09e613b41937a8
as more verbose log.
MVC configuration (https://gist.github.com/anonymous/5620538):
@EnableWebMvc
@Configuration
@ComponentScan(useDefaultFilters = false, basePackages = {"com.blah.blah.web"},
includeFilters = {@ComponentScan.Filter(Controller.class)})
public class WebFaceSpringConfiguration extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
/*
* Server static resources from the src/main/resources/webapp/resources
* directory. Perhaps rename resources to static.
*/
registry.addResourceHandler("/resources/**").addResourceLocations(
"classpath:/webapp/");
/*
* Favicon mapping.
*/
registry.addResourceHandler("/favicon.ico").addResourceLocations(
"/resources/favicon.ico");
}
@Bean
public InternalResourceViewResolver configureInternalResourceViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/pages/");
resolver.setSuffix(".jsp");
return resolver;
}
}
When I use WebAppContext instead of ServletContextHandler, jetty just serves static content from my ‘webapp’ (from classpath).
When I use WebAppContext and servlet mapping ‘/*’ instead of ‘/’ I have PageNotFound again (as in case of ServletContextHandler and mapping ‘/’):
No mapping found for HTTP request with URI [/WEB-INF/pages/main-page.jsp] in DispatcherServlet with name 'org.springframework.web.servlet.DispatcherServlet-1873262757'
From: jetty-users-bounces@xxxxxxxxxxx [mailto:jetty-users-bounces@xxxxxxxxxxx]
On Behalf Of Rossen Stoyanchev
Sent: Tuesday, May 21, 2013 6:44 PM
To: JETTY user mailing list
Subject: Re: [jetty-users] Spring MVC cannot find JSPs when deployed into embedded Jetty 8 server
Why don't you post the exact exception message and relevant parts of the stack trace? Maybe also the parts of the Spring MVC configuration that relate -- like view resolution, also whether mvc namespace is used or not, mvc:default-servlet-handler,
etc? It'd be hard for anyone to answer your question without this basic information.
В этом сообщении вирусы не обнаружены.
Проверено AVG - www.avg.com
Версия: 2013.0.3272 / Вирусная база данных: 3162/6282 - Дата выпуска: 29.04.2013
Внутренняя база данных Вирусная база данных устарела.