Hi, you should use javax.servlet.http.HttpServletResponse.

regards
Ying
----- Original Message ----- 
From: "Antony Stace" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 05, 2002 11:50 AM
Subject: Please show me how to set Cache-Control, Pragma, Expires in response from 
Filter


> Hi
> 
> I am writing a filter and want to be able to set the values of
> Cache-Control, Pragma, Expires in the response.  However I cannot
> do this, here is an outline of what I have
> 
> ------------snip start------------------
> public class TestFilter implements Filter
> {
>     private FilterConfig filterConfig;
>     public void doFilter (ServletRequest request,
>                           ServletResponse response,
>                           FilterChain chain)
>     {
>         try
>         {
>              ///I want to do the following lines, but
>             //ServletResponse does not have a setHeader() method
>             response.setHeader("Cache-Control", "no-cache");
>             response.setHeader("Pragma", "no-cache");
>             response.setHeader("Expires", "-1");
> 
> ------------snip end------------------
> 
> How can I set these values?
> 
> Cheers
> 
> Tony
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
> 
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> 
> 
> 
�{.n�+���zw^�����b����ڽ�.��&jwb��nu觶��ܨ~�^��,j��       �}�ER�L�SL
܆+޲m��ڭ�b��#j���w(���r�z��z��zا��޲�m�T^���q�!���6�j˧r������l�ǫ�W���mz�ږ�����z�m�R�I4�EQޖ�m����
%���r�����j[?�ǫ���f


Reply via email to