两者作用一致
package controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value="/us")
public class MyController {
@RequestMapping("/click")
public String sessionTest1(){
return "redirect:/index.jsp";
}
}
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="us/click" method="POST">
<input type="submit" value="提交"/>
</form>
</body>
</html>