作者:拍友2602921297 | 来源:互联网 | 2024-10-14 19:41
单个参数设置注解:
@Controller
@RequestMapping("/user")
@SessionAttributes("user")
public class UserController {@ReuqestMapping("/getUser")public STRING getUser(Model model) {model.addAttribute("user","user");RETURN "index.jsp"}
}
多个参数设置注解:
@Controller
@RequestMapping("/user")
@SessionAttributes(value={"user","limit"})
public class UserController {@ReuqestMapping("/getUser")public STRING getUser(Model model) {model.addAttribute("user","user");model.addAttribute("limit","limit");RETURN "index.jsp"}
}