You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rob Leland <Ro...@freetocreate.org> on 2001/02/15 00:13:37 UTC
[Fwd: Re: Avoid JSP caching by the browser]
Use the Action.saveToken(), Action.resetToken(),
Action.isTokenValid() for
form transactions. This does exactly what you want.
see
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg02888.html
for the thread that discusses this.
Lind Jürgen wrote:
>
> Hi there,
>
> I have the following problem: in order to prevent the web-browser
> from using cached versions of a jsp, we plan to add some unique
> timestamp (which will actually be ignored by the jsp) to the url
> that calls the jsp, e.g.:
>
> <a href="/jsp/view.jsp?ts=<%= System.currentTimeMillis()%>">myjsp</a>
>
> While this works fine when cookies are enabled, it fails when
> cookies are disabled because it does not make use of the URL
> rewriting capabilities of the Struts taglib.
>
> Using the html:link tag, however, introduces the difficulty how to
> dynamically add the timestamp. Using something like
>
> <html:link href="/jsp/view.jsp?ts=<%=
> System.currentTimeMillis()%>">myjsp</html:link>
>
> fails as the Java Code will not get interpreted but it will be literally
> appended to the URL, causing a Decode Error in the receiving JSP.
>
> Has anyone experienced similar problems (with the web browser caching
> jsp pages) and could offer some help or are there any suggestions wrt.
> the above evaluation problem?
>
> Regards
>
> Jürgen
>
> --
> Dr. Jürgen Lind
> iteratec GmbH Fon: +49 (0)89 614551-44
> Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
> 82008 Unterhaching Web: www.iteratec.de