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. Advertisements

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:
    451
  2. Sung Jin Hwang

    Any good way to extend std::swap?

    Sung Jin Hwang, Jan 20, 2006, in forum: C++
    Replies:
    1
    Views:
    519
    red floyd
    Jan 20, 2006
  3. Replies:
    0
    Views:
    514
  4. CSharpner
    Replies:
    0
    Views:
    1,427
    CSharpner
    Apr 9, 2007
  5. David T
    Replies:
    3
    Views:
    629
    Alf P. Steinbach
    Mar 8, 2009
  6. Replies:
    0
    Views:
    250
  7. Alexandru Popescu

    include and extend Module - Ruby Way

    Alexandru Popescu, Aug 21, 2005, in forum: Ruby
    Replies:
    9
    Views:
    240
    Devin Mullins
    Aug 22, 2005
  8. kevin
    Replies:
    1
    Views:
    516
    Kairi Zikpin
    Jul 21, 2006
Loading...