/** * @RequestMapping 除了修饰方法 还可以修饰类 * 1).类定义处:提供初步的请求映射信息,相当于WEB应用的根目录 * 2).方法定义处,提供进一步的细分映射信息,相对于类定义处的URL.若类定义处没有标注的话, * 则方法处的标记URL相当于WEB应用的根目录 * @au ...
分类:
编程语言 时间:
2016-10-03 00:18:13
阅读次数:
254
1、第一步,首先搭建如下架构,其中,annotation中放置自己编写的注解,主要包括service controller qualifier RequestMapping 第二步:完成对应的annotation: 1 package com.cn.annotation; 2 3 import ja ...
分类:
编程语言 时间:
2016-09-25 20:37:24
阅读次数:
1201
/**进入系统首页*/ @RequestMapping("/index.do") publicStringindex(HttpServletResponseresponse) { Cookiecookie=newCookie("jsessionid","2jcligmgi6fh"); cookie.setMaxAge(Integer.MAX_VALUE); response.addCookie(cookie); return"main"; }
分类:
编程语言 时间:
2016-09-24 22:01:36
阅读次数:
255
/**进入系统首页*/@RequestMapping("/index.do")publicStringindex(HttpServletResponseresponse){Cookiecookie=newCookie("jsessionid","2jcligmgi6fh");cookie.setMaxAge(Integer.MAX_VALUE);response.addCookie(cookie);return"main";}
分类:
编程语言 时间:
2016-09-24 22:00:00
阅读次数:
154
1、SpringMVC使用@RequestMapping注解为控制器指定可以处理哪些URL请求。 2、在控制器的类定义和方法定义处都可标注@RequestMapping 2.1 类定义处:提供初步的请求映射信息。相对于WEB应用的根目录 2.2 方法处:提供进一步的细分映射信息。相对于类定义处的UR ...
分类:
移动开发 时间:
2016-09-23 14:54:54
阅读次数:
200
DispatcherServlet接受一个web请求之后,将请求发送给@Controller注解声明的不同控制器类。 这个调度过程依赖控制器类及其处理程序方法中声明的各种@RequestMapping注解。 Spring MVC中,web请求通过控制器类中声明的一个或者多个@RequestMappi... ...
分类:
移动开发 时间:
2016-09-20 23:44:16
阅读次数:
168
SpringMVC 概述 Spring 为展现层提供的基于 MVC 设计理念的优秀的Web 框架,是目前最主流的 MVC 框架之一 Spring3.0 后全面超越 Struts2,成为最优秀的 MVC 框架 Spring MVC 通过一套 MVC 注解,让 POJO 成为处理请求的控制器,而无须实现 ...
分类:
移动开发 时间:
2016-09-19 22:20:03
阅读次数:
759
效果图: controller层方法: /** * * 导出Excel报表 * @param request * @return * */ @RequestMapping("/export") @ResponseBody public void export(HttpServletRequest r ...
分类:
其他好文 时间:
2016-09-19 19:22:06
阅读次数:
298
一般我们在Controller层,会编写类似这样的方法 @Controller @RequestMapping(value="/detail") public class GetURIDetailController { 本质上Controller就是一个spring 组件,所以在我的请求方法 ge ...
分类:
编程语言 时间:
2016-09-19 07:51:01
阅读次数:
683
目的 了解Spring mvc 学习对象 https://github.com/spring-projects/spring-mvc-showcase 学习收获 1. 自定义注解 2. RequestMapping注解 可修饰类 和 方法,对应的url按层级累加 可指定Get/Post方法 3. j ...
分类:
编程语言 时间:
2016-09-18 22:10:23
阅读次数:
196