Home > Back-end >  Configuration at is right but for springmvc does not perform the controller layer
Configuration at is right but for springmvc does not perform the controller layer

Time:05-11

This is the spring configuration:
 & lt; ? The XML version="1.0" encoding="utf-8"?> 
XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance"
XMLNS: context="http://www.springframework.org/schema/context"
XMLNS: p="http://www.springframework.org/schema/p"
XMLNS: MVC="http://www.springframework.org/schema/mvc"
Xsi: schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd "& gt;



Web.xml:
 & lt; ? The XML version="1.0" encoding="utf-8"?> 
XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
Version="4.0" & gt;


Springmvc

Org. Springframework. Web. Servlet. DispatcherServlet

ContextConfigLocation
The classpath: applicationContext. Xml

1 & lt;/load - on - startup>


Springmvc
/& lt;/url - pattern>




Controller:


Start tomcat can start success


But the access controller: direct 404 doesn't even have method execution (background no output information)


Bosses help!!!!!!

CodePudding user response:

/& lt;/url - pattern> Change & lt; url-pattern>/* Have a try

CodePudding user response:

refer to the original poster I speak you know reply:
this is the spring configuration:


But the access controller: direct 404 doesn't even have method execution (background no output information)


Bosses help!!!!!!


The lack of project name

The http://localhost:8080/project name/test

CodePudding user response:

refer to the second floor qq_39936465 response:
Quote: refer to the original poster I speak you know reply:
this is the spring configuration:


But the access controller: direct 404 doesn't even have method execution (background no output information)


Bosses help!!!!!!


The lack of project name

The http://localhost:8080/project name/test

Tomcat configuration is directly/and can start success should be not sent the project name

CodePudding user response:

reference 1/f, one born in response:
& lt; url-pattern>/& lt;/url - pattern> Change & lt; url-pattern>/* Try

Not do?
  • Related