jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -
I'm only using annotation configuration, the server starts, but when I use some pages error is displayed:
Warning: no mapping found for HTTP request with URI [/WEB-INF/view/main.jsp] name 'org.springframework.web.servlet.DispatcherServlet -D7259e with DispatcherServlet in
Controller mapping works fine, but no JSP page is full.
I am using Jetty 9.2.0.M0 and Spring MVC 4.0.4 release.
JetTyP Config:
Private Static Last String CONTEXT_PATH = "/"; Private Static Last String MAPPING_URL = "/ *"; Private Zero Server (Int port) throws exceptions {server server = new server (port); Server.addLifeCycleListener (New LifeCycleListener ()); Server.setHandler (getServletContextHandler (getContext ())); Server.start (); Server.join (); } Private static ServletContextHandler getServletContextHandler (WebApplicationContext context) throws IOException {LOGGER.info ( "ServletContextHandler is ready"); CircleContaxHandler themeHandler = new circactontex handler (); ContextHandler.setContextPath (CONTEXT_PATH); ContextHandlerkaddServlet (new ServletHolder (new DispatcherServlet (reference), MAPPING_URL); ContextHandler.addEventListener (new Sndrbloder Listnr (reference)); return Sndrbhandlr;} private static WebApplicationContext getContext () {LOGGER.info ( "Preparation of annotations reference") ; lecture config web Aplikeshns Contact context = new Antateshn config web Aplikeshn Contact (); context.register (SpringMVCConfig.class); return context;}
SpringMVCConfig:
@Configuration @ComponentScan (basePackages = "my.package.controller") @EnableWebMvc Public Class SpringMVCConfig Lee WebMvcConfigurerAdapter {private static final Logger LOGGER = Logmanejrkgetlagajr (Springmvisisifig. Class); @ Override public void AddResourceHandlers (Snsadnhandlr registry) {LOGGER.info (add "resource handlers"); RegistrykaddResourceHandler ( "/ i / * * ") addResourceLocations (" classpath: WEB-INF / images / ") .;. Registry.addResourceHandler (" / C / ** ") addResourceLocations (" classpath: WEB-INF / CSS / "); . Registry.addResourceHandler ("/ js / **") addResourceLocations ("classpath: web-INF / javascripts /"); } @ Bean Public View Resource Build Ready Resolor () {LOGGER.info ("Resolving View Resolver"); InternalResourceViewResolver Resolver = New InternalResourceViewResolver (); Resolver.setPrefix ("Web-INF / View /"); Resolver.setSuffix ("jsp."); // resolver.setViewClass (JstlView.class); Return resolver; }}
There is no web.xml nor any other xml files.
thanks.
"itemprop =" text ">
after using this skeleton on the dot hit, this is a work example -
Comments
Post a Comment