Announcement Announcement Module
Collapse
No announcement yet.
WARN : PageNotFound - No mapping found for HTTP request Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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!

  • #2
    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 ..

    Comment


    • #3
      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...

      Comment

      Working...
      X