way to extend JSPs or config for no-cache?

Discussion in 'Java' started by Tom, Sep 13, 2003.

  1. Tom

    Tom Guest

    Hi,

    I would like all my JSPs to have headers attached to prevent them from
    being cached. What I want to avoid is having to add:

    <%
    response.setHeader("Cache-Control","no-store"); // HTTP 1.1
    response.setHeader("Pragma","no-cache"); // HTTP 1.0
    response.setDateHeader ("Expires", 0); // prevents caching at the proxy
    server
    %>

    to all my pages. Is there a way to override the JSP method that spits out
    the HTML code to add these headers, or is there some sort of config file I
    can edit? I'm using tomcat 4 with Struts 1.1. I've used the "nocache"
    parameter of the controller module and that works great for anything that
    Struts spits out, but of course it doesn't affect any JSP pages since tomcat
    is handling that.

    Thanks,

    -Tomas
    Tom, Sep 13, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PiedmontBiz
    Replies:
    2
    Views:
    318
  2. Sung Jin Hwang

    Any good way to extend std::swap?

    Sung Jin Hwang, Jan 20, 2006, in forum: C++
    Replies:
    1
    Views:
    390
    red floyd
    Jan 20, 2006
  3. Replies:
    0
    Views:
    386
  4. CSharpner
    Replies:
    0
    Views:
    1,012
    CSharpner
    Apr 9, 2007
  5. kevin
    Replies:
    1
    Views:
    369
    Kairi Zikpin
    Jul 21, 2006
Loading...

Share This Page