how can i use jstl code to clear ie cache???

hi,experts,
  now i use
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>
to clear ie cache

i want use jstl to do it,how can i do it???

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
?????

thanks!
hgbdelphiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bloodredsunCommented:
<c:out value='${pageContext.response}'/> returns an object of class org.apache.coyote.tomcat4.CoyoteResponseFacade which implements the HttpServletResponse. So you have access to all the methods you normally would to alter reponse object values.
0
bloodredsunCommented:
I would rather recommend including a page fragment "nocache.jsp", using c:import that just used the scriplet above so that you take it out of your code and increase re-usability as it allows you to have that code in all your pages but only have to maintain the one version.

e.g.

nocache.jsp
--------
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>

myPage.jsp
--------
<%@ taglib uri='http://java.sun.com/jstl/core' prefix='c' %>
<c:import  url='nocache.jsp' />
<html>
.......
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bloodredsunCommented:
Actually, if you go here http://www.phptr.com/articles/article.asp?p=30946&seqNum=7 (scroll down to respose properties) you cannot alter response headers via JSTL as you only have access to 4 properties: bufferSize, characterEncoding, locale, committed
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

TimYatesCommented:
>> nocache.jsp

This is better (covers more browser versions, and sme IE bugs of old)...

<%
    // Set to expire far in the past.
    response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");

    // Set standard HTTP/1.1 no-cache headers.
    response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");

    // Set IE extended HTTP/1.1 no-cache headers (use addHeader).
    response.addHeader("Cache-Control", "post-check=0, pre-check=0");

    // Set standard HTTP/1.0 no-cache header.
    response.setHeader("Pragma", "no-cache");
%>
0
hgbdelphiAuthor Commented:
thanks for bloodredsun and TimYates

i use <c:import  url='nocache.jsp' /> to do it now!

to TimYates
  say sorry for not give your points.:)
0
bloodredsunCommented:
It is possible to split points. If you are using any of TimYates' code I think it would be fair to give him some points. If you want to you can go the the Community Support topic area and ask for a mod to re-assign the points to give him some. What do you think Tim?
0
TimYatesCommented:
It would be nice, but this is only a 50 point question...so I'm just glad we could help :-)

hgbdelphi, for future reference, there is a "Split Points" link just above the comment box that you can use to assign points to all the different people who helped :-)

Good luck with it though :-)

Tim
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.