@Controller
@RequestMapping("/user")
public class UserController {
@RequestMapping("/quick4")
@ResponseBody
public void save4(String[] s){
System.out.println(Arrays.asList(s));
}
@RequestMapping("/quick3")
@ResponseBody
public void save3(User user){
System.out.println(user);
}
@RequestMapping("/quick2")
@ResponseBody
public String save2(User user){
user.setName("zhangsan");
user.setAge(18);
System.out.println(user);
return user.toString();
}
@RequestMapping("/quick1")
@ResponseBody
public String save1(){
return "success";
}
@RequestMapping("/quick")
public String save(){
return "/success.jsp";
}
} |
|