Spring MVC page not found no mapping found for HTTP request with Uri

Source: Internet
Author: User

The error I reported here is:

14:02:15, 736 warn [pagenotfound] No mapping found for HTTP request with Uri [/spring3mvc/ABC/index. Do] In dispatcherservlet with name 'spring3mvc'

[Spring3mvc/ABC/index. Do] is the path of my request. For my current project, the path of my request is:

Http: // localhost: 8080/spring3mvc/ABC/index. Do

Spring3mvc is my project name, ABC is used for Action annotation, and index is the method annotation.

@Controller@RequestMapping("/abc")public class ZhujieRequestController  {    protected final transient Log log = LogFactory.getLog(ZhujieRequestController.class);    @RequestMapping("/index")    public String index() {        return "hello";    }}

Other configuration files, such as web. xml and some JDBC connections I will not say, it is said that the core XML file: spring3MVC-servlet.xml

<? XML version = "1.0" encoding = "UTF-8"?> <Beans xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: Tx = "http://www.springframework.org/schema/tx" xmlns: context = "http://www.springframework.org/schema/context" xmlns: MVC = "http://www.springframework.org/schema/mvc" xsi: schemalocation = "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1. Xsdhttp: // your http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd "> <! -- Automatically scans the package name --> <context: component-scan base-package = "com. ideawu"/> <! -- Support for default annotation ing --> <! -- <MVC: annotation-driven/> --> <! -- View interpretation class --> <bean id = "viewresolver" class = "org. springframework. web. servlet. view. internalresourceviewresolver "> <property name =" prefix "value ="/"/> <property name =" suffix "value = ". JSP "/> <! -- Can be empty to facilitate the selection of view interpretation class Logic Based on the extension --> <property name = "viewclass" value = "org. springframework. web. servlet. view. jstlview "/> </bean> <! -- Request the method in action through annotation --> <bean id = "annotationhandlermapping" class = "org. springframework. web. servlet. MVC. annotation. defaultannotationhandlermapping "> <property name =" order "value =" 0 "/> <property name =" usedefasusuffixpattern "value =" false "/> <! -- Note that value = "false" is false. I got two o'clock P.M. from a.m. --> </bean> <beanclass = "org. springframework. web. servlet. MVC. annotation. annotationmethodhandleradapter "/> </beans>

This is the basic configuration. the restart of the service is changeable, and it will never work.

<property name="useDefaultSuffixPattern" value="false" />

To true. Ah, I just learned this problem. Good luck.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.