摘要: 用于指定WEB容器的过滤器,在请求和响应对象在Servlet处理之前和之后,可以通过此过滤器对这两个对象进行处理。 代码: <pre class="html" name="code"><filter> <filter-name>encodingfilter</filter-name> <filter 阅读全文
posted @ 2018-03-26 12:41 李慢慢 阅读(127) 评论(0) 推荐(0)
摘要: long before = System.currentTimeMillis(); long after = System.currentTimeMillis(); 这两句代码定义了doFilter()过滤用户请求的范围。 HttpServletRequest hrequest = (HttpServletRequest) request; HttpServletRequest接口是ServletRequest子接口,HttpServletRequest接口遵循http协议。将请求转换成HttpServletRequest请求。 System.out.println("Filter 已经截获到用户的请求的地址: " + hrequest.getSeryletPath() ); 输出提示信息,输出截获到用户的请求的地址。 阅读全文
posted @ 2018-03-26 12:39 李慢慢 阅读(115) 评论(0) 推荐(0)
摘要: 用途 定义 这里主要讨论cookie和session有什么区别? Session和cookie的区别与联系 cookie是把用户的数据写在用户本地浏览器上, 其他网站也可以扫描使用你的cookie,容易泄露自己网站用户的隐私,而且一般浏览器对单个网站站点有cookie数量与大小的限制。 Sessio 阅读全文
posted @ 2018-03-26 12:37 李慢慢 阅读(207) 评论(0) 推荐(0)