HttpServletRequ接口的使用和jsp内置对象的request对象非常类似,request对象其实就是HttpServletRequest接口的一个实例,不过气实例化的过程是自动的,无须自定义。以下示例达到的效果为:通过一个HttpServletRequest接口的实利化对象设置并取得re...
分类:
Web程序 时间:
2015-08-25 15:43:22
阅读次数:
741
2.指定Web应用的默认编码集,相当于调用 HttpServletRequest的setCharacterEncoding方法。3.该属性设置是否每次HTTP请求到达时,系统都重新加载资源文件。该属性默认值是false。在开发阶段将该属性设置为true会更有利于开发, 但在产品发布阶段应将该属性设....
分类:
其他好文 时间:
2015-08-21 13:14:35
阅读次数:
178
@RequestMapping("/act/worldcup_schedule_time/imgdownload") @ResponseBody public String scheduleDownload(HttpServletRequest request, HttpServ...
分类:
移动开发 时间:
2015-08-20 12:59:28
阅读次数:
155
缓存时间的设置:1 public void doGet(HttpServletRequest request, HttpServletResponse response)2 throws ServletException, IOException {3 4 r...
分类:
其他好文 时间:
2015-08-19 12:37:40
阅读次数:
123
JSP内置对象有:1.request对象 客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应。它是HttpServletRequest类的实例。2.response对象 response对象包含了响应客户请求的有关信息,但在JSP中很少直接用到它。它是Http.....
分类:
Web程序 时间:
2015-08-18 19:03:12
阅读次数:
118
public ActionForward sdsd(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws Exception {
String openid=request.getParameter("openid");
C...
分类:
其他好文 时间:
2015-08-18 16:26:59
阅读次数:
147
Attribute 和 Parameter 的区别(1)HttpServletRequest类有setAttribute()方法,而没有setParameter()方法(2)当两个Web组件之间为链接关系时,被链接的组件通过getParameter()方法来获得请求参数,(3)当两个Web组件之间为...
分类:
其他好文 时间:
2015-08-18 01:14:37
阅读次数:
101
Servlet三要素:1.必须继承自HttpServlet2.必须实现doGet()或者doPost()3.必须在web.xml中配置Servletxxx包名+类名必须与上面的name一致/+名字HttpServletRequest:请求对象getParameter():获得表单元素的值getAtt...
分类:
Web程序 时间:
2015-08-17 18:56:06
阅读次数:
116
public static String getClientIp(HttpServletRequest request) { ? ? ? ?String address = request.getHeader("X-Real-IP"); ? ? ? ? if (org.apache.commons.lang3.StringUtils.isNotBlank(address)...
分类:
Web程序 时间:
2015-08-17 17:40:42
阅读次数:
231
于HttpServletRequest 相关的监听有 ServletRequestListener,ServletRequestAttributeListener也就是servletRequest对象生命周期的监听和request对象中属性的添加,修改,移除等属性值变动的监听
通过这request 生命周期的监听我们可以知道 servletRequest 的生命周期,也就是一个请求,当我们...
分类:
Web程序 时间:
2015-08-16 12:21:30
阅读次数:
180