用tomcat做服务器,
在web应用的web.xml中配置了filter,来过滤所有用户请求,比如请求a.jsp。
在a.jsp中已经设置了禁止客户端缓存,如下:
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
现在的问题是当浏览器第一次点击链接到a.jsp的链接的时候,
在filter中拦截到了请求,在a.jsp中的system.out.print也可以输出内容。
但是当浏览器再次点击这个链接,filter拦截不到请求,a.jsp中都没有发现这个请求。
把这个链接地址贴在地址栏中,回车后,filter、a.jsp也没有拦截到这个请求,
只有在浏览器刷新a.jsp这个页面才能拦截到这个请求。现在我想要每次用户点击链接,都要在filter中拦截到这个请求,
该怎么做?
解决方案 »
- EJB技术要的多吗?
- Servlet execution threw an exception
- weblogic 配置多Server出现的问题
- 求教一种网页特效!有经验的大大们来帮我看看吧
- Hibernet+Spring+MS SQL2008更新失败:Could not synchronize database state with session
- html中注释问题
- 请问在使用SSH框架时如何查询主外键关系的主表全部信息?
- 访问WebService时出现异常,请帮我看看这个异常信息是什么意思?
- ibatis 多表关联查询的问题,请大家来看下,谢谢
- 一个hibernate 中list 一对一的问题
- JAVA代码的疑问?
- 一家飞机坠毁在荒岛上,幸存了10个人,直升飞机每次只能救一个人,给下列人排序:生物学家、生态学家、科学家、孕妇、天才儿童、航天员、警察、流浪汉、运动员和……忘
<filter>
<filter-name>secureFilter</filter-name>
<filter-class>
interceptor.Guard
</filter-class>
</filter>
<filter-mapping>
<filter-name>secureFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
咋办
难道要每次发一个随机码过去?
让浏览器认为是一个新请求,就会每次访问服务器了