Home > front end >  New controller cannot jump to 404 page when using SSM
New controller cannot jump to 404 page when using SSM

Time:09-16

Here a description of my own problems first
I am learning the early stages of the SSM, and then also follow online tutorial step by step, but it is time to design the controller out of the mistake, after repeated comparison and net class code can be said to be apart from some different package name, the other is the same, find a lot of posts on the net, is with good configuration file, or no scan packages, or the address is wrong, but I was right, but how to test is wrong, but stopped about a incredibly can be used after the afternoon, a face of meng
Post about the controller I wrote

 
Package mycode. Controller;

The import org. Springframework. Stereotype. The Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@ Controller
Public class mycontroller {
@ RequestMapping ("/test ")
Public String test ()
{
Return "test";
}
}

XML application.
 & 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: aop="http://www.springframework.org/schema/aop"
XMLNS: tx="http://www.springframework.org/schema/tx"
Xsi: schemaLocation="HTTP://http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd "& gt;

Expression="org. Springframework. Stereotype. Controller"/& gt;






























XML dispatcherServlet - servlet.
 & 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: MVC="http://www.springframework.org/schema/mvc"
Xsi: schemaLocation="HTTP://http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd "& gt;











nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related