java - Spring MVC mapping doesn't work after resources mapping implemented -
In my reference file, I want to add a line to be able to access the static content. Everything is fine until I add it, but after adding it, I can not access some controller pages and I get this warning: How can I correct any idea? PS: These pages are protected from spring safety, but I do not think this problem can be. Try to rename your dispatcher servicelet with each Dispatcher sublet - Seals. On the introduction of the Dispatcher Circle, the framework will search for a file named [servlet-name] -Servlet.XM in the web-NF directory of your web application and make beans defined there. Warning: org.springframework.web.servlet. PageNotFound - No mapping found HTTP request with URI [/ fit /] DispatcherServlet with name 'mvc-dispatcher' . The reference file should be
& lt; Mvc: resource mapping = "/ resource / **" location = "/ resource /" /> /> Before adding, it looks like:
& lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Beans xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: reference = "http: // www. Springframework.org/schema/context "xmlns: security =" http://www.springframework.org/schema/security "xmlns: mvc =" http://www.springframework.org/schema/mvc "xsi: schema location = "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context Http : //www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-Security -3.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"> & Lt; Reference: Annotation-config / & gt; & Lt ;! - $ {webappRoot} / HTTP GET handles requests for resources to efficiently serve efficient resources in the Resource Directory - & gt; & Lt; Reference: component-scan base-package = "cz.cvut.fit.genepi.controllers" /> & Lt; Import Resources = "Classpath: applicationContext-security.xml" /> & Lt; Bean square = "org.springframework.web.servlet.view.InternalResourceViewResolver" & gt; & Lt; Property Name = "Prefix" Value = "/ Web-ANF / View /" /> & Lt; Property name = "suffix" value = ".jsp" /> & Lt; / Bean & gt; & Lt; Mvc: resource mapping = "/ resource / **" location = "/ resource /" /> & Lt; / Bean & gt;
Comments
Post a Comment