|
@@ -3,11 +3,24 @@ package com.controller;
|
3
|
3
|
import org.springframework.stereotype.Controller;
|
4
|
4
|
import org.springframework.web.bind.annotation.RequestMapping;
|
5
|
5
|
|
|
6
|
+import javax.servlet.http.HttpServletRequest;
|
|
7
|
+import javax.servlet.http.HttpServletResponse;
|
|
8
|
+import java.io.IOException;
|
|
9
|
+
|
6
|
10
|
@Controller
|
7
|
11
|
public class UserController {
|
8
|
12
|
@RequestMapping("/quick")
|
9
|
|
- public String save() {
|
|
13
|
+ public String quick() {
|
10
|
14
|
System.out.println("userControllerRunning1...");
|
11
|
|
- return "success.jsp";
|
|
15
|
+// return "forward:success.jsp";
|
|
16
|
+ // 加了前后缀 完整链接应该是 forward:/template/success.jsp
|
|
17
|
+ return "redirect:http://baidu.com";
|
|
18
|
+ }
|
|
19
|
+ @RequestMapping("/save")
|
|
20
|
+ public void save(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
21
|
+ // 直接返回字符串
|
|
22
|
+ response.getWriter().println("save");
|
|
23
|
+// return "forward:success.jsp";
|
|
24
|
+
|
12
|
25
|
}
|
13
|
26
|
}
|