Results 1 to 3 of 3

Thread: WARN : PageNotFound - No mapping found for HTTP request

  1. #1

    Default WARN : PageNotFound - No mapping found for HTTP request

    Hi,

    i'm getting error if i try to call "http://localhost:8080/myapp/myprofile/msgs". I can see the page but the style and images are not available :/

    Error is:

    WARN : PageNotFound - No mapping found for HTTP request with URI [/myapp/myprofile/resources/js/jquery/jquery-1.7.1.js] in DispatcherServlet with name 'appServlet'
    WARN : PageNotFound - No mapping found for HTTP request with URI [/myapp/myprofile/resources/js/jquery/ui/jquery.ui.core.js] in DispatcherServlet with name 'appServlet'
    WARN : PageNotFound - No mapping found for HTTP request with URI [/myapp/myprofile/resources/js/jquery/ui/jquery.ui.slider.js] in DispatcherServlet with name 'appServlet'
    WARN : PageNotFound - No mapping found for HTTP request with URI [/myapp/myprofile/resources/js/jquery/ui/jquery.ui.button.js] in DispatcherServlet with name 'appServlet'
    WARN : PageNotFound - No mapping found for HTTP request with URI [/myapp/myprofile/resources/js/jquery/ui/jquery.effects.core.js] in DispatcherServlet with name 'appServlet'
    WARN : PageNotFound - No mapping found for HTTP request with URI [/myapp/myprofile/resources/js/jquery/ui/jquery.ui.widget.js] in DispatcherServlet with name 'appServlet'
    ...
    an so on... css, images not found...
    I guess it happens cause of wrong resource mapping configuration. But i have no idea how i can solve the problem.

    web.xml
    Code:
    	<servlet>
    		<servlet-name>appServlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	
    	<servlet-mapping>
    		<servlet-name>appServlet</servlet-name>
    		<url-pattern>/</url-pattern>
    	</servlet-mapping>

    servlet-context.xml
    Code:
    ...
    	<resources mapping="/resources/**" location="${webappRoot}/resources/" />
    ...
    My controller class
    Code:
    @Controller
    @RequestMapping(value = "/myprofile")
    public class ProfileController {
        
        private static final Logger _logger = MyLoggerFactory.getLogger(ProfileController.class);
      
        
        @RequestMapping(method = RequestMethod.GET, value="/msgs")
        public String openMsgs(HttpServletRequest request) {
            //
    
            return ProfilePage.MESSAGES.file;
        }
    }
    Thanks in advance for the help!
    Spring!! New Version -> New Tutorial

  2. #2
    Join Date
    Jul 2012
    Posts
    1

    Default

    Hi,

    Can you access: "http://localhost:8080/myapp/myprofile/resources/js/jquery/jquery-1.7.1.js"

    and double check your resources mapping on the physical path ..

  3. #3

    Default

    hi

    problem is, if i try to call "www.myapp.com/myprofile" everything is OK. But if im calling "www.myapp.com/myprofile/msgs" the error occurs...


    servlet-context.xml

    Code:
    ...
    	<resources mapping="/resources/**" location="/resources/" />
    ...
    Resources are mapped for path "resources/**" but i need something like "*resources/**"

    The call "www.myapp.com/myprofile/msgs" requires resources from myprofile/resources...

    No idea why it happens...
    Spring!! New Version -> New Tutorial

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •