摘要: /** * 目标方法的返回值可以是 ModelAndView 类型。 * 其中可以包含视图和模型信息 * SpringMVC 会把 ModelAndView 的 model 中数据放入到 request 域对象中. * @return */ @RequestMapping("/testModelAn 阅读全文
posted @ 2018-02-10 15:44 逆水乘舟,不进则退 阅读(172) 评论(0) 推荐(0) 编辑
摘要: /** * 可以使用 Serlvet 原生的 API 作为目标方法的参数 具体支持以下类型 * * HttpServletRequest * HttpServletResponse * HttpSession * java.security.Principal * Locale InputStrea 阅读全文
posted @ 2018-02-10 15:20 逆水乘舟,不进则退 阅读(140) 评论(0) 推荐(0) 编辑
摘要: /** * 了解: * * @CookieValue: 映射一个 Cookie 值. 属性同 @RequestParam */ @RequestMapping("/testCookieValue") public String testCookieValue(@CookieValue("JSESSI 阅读全文
posted @ 2018-02-10 14:59 逆水乘舟,不进则退 阅读(942) 评论(0) 推荐(0) 编辑
摘要: jsp页面 <a href="springmvc/testRequestParam?username=atguigu&age=11">Test RequestParam</a> /** * @RequestParam 来映射请求参数. value 值即请求参数的参数名 required 该参数是否必 阅读全文
posted @ 2018-02-10 10:42 逆水乘舟,不进则退 阅读(393) 评论(0) 推荐(0) 编辑
摘要: @PathVariable /** * @PathVariable 可以来映射 URL 中的占位符到目标方法的参数中. * @param id * @return */ jsp页面请求 <a href="springmvc/testPathVariable/1">Test PathVariable< 阅读全文
posted @ 2018-02-10 09:21 逆水乘舟,不进则退 阅读(7442) 评论(0) 推荐(0) 编辑