开发者

Action is not calling in struts2 while clicking on the link at the second time

I am new to struts2. I have page to display the list of开发者_运维知识库 elements. Each element contains the link to open the another window to show the related information. First while clicking on that link its fetching deatils from db and working correctly. but second time it is showing previously shown data. the same thing is working in IE 7 correctly. In IE8 its making this problem.how to reslove it programatically?


Make sure you're explicitly disabling caching on your pages. The following would be how it's done at the top of a JSP in a scriptlet:

<%
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    response.setDateHeader ("Expires", -1); 
%>

For extra IE cache busting power, you can add a second <head> below your </body>. The complete code, including the above scriplet looks as follows:

<%
    response.setHeader("Cache-Control","no-cache"); 
    response.setHeader("Pragma","no-cache"); 
    response.setDateHeader ("Expires", -1);
%>
<html>
<head></head> 
<body>
   Your body content
</body>

<!--[if IE]>
<head> 
    <meta http-equiv="pragma" content="no-cache"/> 
    <meta http-equiv="Expires" content="-1"/> 
</head> 
<![endif]-->

</html>

Notice that you serve the second, invalid <head> in conditional comments so only our special friend IE gets it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜