Home > Back-end >  For SpringMVC into the first day, after give class @ RequestMapping request is less than the web - r
For SpringMVC into the first day, after give class @ RequestMapping request is less than the web - r

Time:10-03

 & lt; % -- -- 
Created by IntelliJ IDEA.
User: hasee
Date: 2020/3/30
Time: and
"To change this template use File | Settings | File Templates.
- % & gt;
<% @ page contentType="text/HTML. Charset=utf-8 "language=" Java "% & gt;


Title

<body>

<% - & lt; A href="https://bbs.csdn.net/topics/user/hello" & gt; Entry procedures & lt;/a> - % & gt;





 package com. Itheima. Controller; 

The import org. Springframework. Stereotype. The Controller;
The import org. Springframework. Web. Bind. The annotation. RequestMapping;

@ Controller
@ RequestMapping (path="/user")
Public class HelloController {
@ RequestMapping (path="/hello!")
Public String sayHello () {
System. The out. Println (" Hello StringMVC ");
Return "success";
}


@ RequestMapping (path="/testRequestMapping")
Public String testRequestMapping () {
System. The out. Println (" test RequestMapping notes ");
Return "success";
}
}



Using the idea of
Only add @ RequestMapping after method can jump to webinf/pages/success.
JSP pageAfter class to add @ RequestMapping (path="/user") request to the method, after but not request to success. The JSP page

CodePudding user response:

When find the problem, the configuration XML values="WEB - INF/pages", should be values="/WEB - INF/pages"
  • Related