通过url访问方法即可进行下载 @RequestMapping("down") public String down(HttpServletRequest request,HttpServletResponse response) throws IOException{ //设置向浏览器端传送的文件 ...
分类:
编程语言 时间:
2016-06-28 10:44:04
阅读次数:
311
StringMVC做登录拦截 1:拦截类 package cn.sjt.ums.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; impo ...
分类:
Web程序 时间:
2016-06-27 19:16:57
阅读次数:
196
@RequestMapping(value={"/list"},method=RequestMethod.GET) @ResponseBody public DeviceList getdevicelist(HttpServletRequest request, HttpServletRespons ...
分类:
编程语言 时间:
2016-06-25 21:40:20
阅读次数:
179
HttpServletRequest类既有getAttribute()方法,也有getParameter()方法,这两个方法有以下区别:1、HttpServletRequest类有setAttribute()方法,而没有setParameter()方法;2、当两个Web组件之间为链接关系时,被链接的 ...
分类:
其他好文 时间:
2016-06-23 20:32:20
阅读次数:
97
在程序里面,讲究“高内聚,低耦合”。Struts2采用MVC架构,使用Action来处理http请求并进行响应,而不使用Servlet。但是,我们知道,Servlet的含义就是“服务器端的小应用程序”,它包含了HttpServletRequest、HttpServletResponse、HttpSession和ServletContext等对象。当我..
请求与转发: 当请求来到HTTP服务器,而HTTP服务器转交请求给容器时,容器会创建一个代表当前请求的HttpServletRequest对象,并将请求 相关信息设置给该对象。同时,容器创建一个HttpServletResponse对象。对客户端进行响应的Java对象。 处理请求参数与标头 请求来到 ...
分类:
其他好文 时间:
2016-06-22 00:23:01
阅读次数:
150
1、什么WEB资源? HttpServletRequest,HttpServletRespone,HttpApplication,ServletContext,HttpSession等原生ServletAPI。 2、在Struts2中为什么要访问WEB资源? B/S应用中的Controller必然会 ...
分类:
Web程序 时间:
2016-06-19 19:51:01
阅读次数:
244
1.0 HttpServletRequest对象-java对http请求的封装 这个对象的主要作用是获取请求的参数信息 核心的API 请求行 request.getMethod(); //请求方式 requset.getRequetURI() / request.getRequestURL(); / ...
分类:
编程语言 时间:
2016-06-18 18:36:46
阅读次数:
229
1 发布一个接口 在方法参数中传入servlet相关的HttpServletRequest ...就可以在控制器中使用request对象。 这只是简单的测试helloword级别的不包含任何业务逻辑 2 测试 访问http://localhost:8080/springmvc/ServiceAPIS ...
分类:
编程语言 时间:
2016-06-18 11:27:12
阅读次数:
190
// 下载模板 @RequestMapping("/download") @ResponseBody public ResponseEntity<byte[]> download(HttpServletRequest request)throws IOException { String path= ...
分类:
其他好文 时间:
2016-06-18 11:21:57
阅读次数:
1044