Getting “WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI …” when trying to setup spring servlet

后端 未结 3 497
萌比男神i
萌比男神i 2021-01-25 07:56

I am trying to setup a Spring MVC project. I have added a dispatcher servlet, a jsp and setup the web.xml file. But I keep getting

WARN org.springframew

3条回答
  •  星月不相逢
    2021-01-25 08:39

    You seem to be missing the

    
    
    
        
        
    
        
    
        
            
            
            
        
    
    

    note that I've removed the version from the xsd files, this means that it will use the schema from your jar files (and there will be a validation error in case of incompatibilty)

    after @Nikolay's comment, I've also noticed an error in your mapping (note that you still need the annotation-driven element), you should either change the mapping in your controller to

    @RequestMapping("/hello.jsp")
    

    and access it via

    /safesite/hello.jsp
    

    OR, more common, change the servlet mapping to

    
        HelloWeb
        /
    
    

    and access as Nikolay said so /safesite/hello

提交回复
热议问题