tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Wingfield <jon.wingfi...@mkodo.com>
Subject Re: Fw: sendRedirect using <jsp:include ...>
Date Wed, 09 Apr 2003 09:54:59 GMT
You can't do this. Once the data (ie html or whatever) has started to be 
written the http headers are long gone ;)

If you're using tomcat 4 or any servlet 2.3 compliant container then use 
a filter to set your headers before writing the content down the 
response stream. Map your filter with something like this:

<filter-mapping>
   <filter-name>http-headers-filter</filter-name>
   <url-pattern>/*</url-pattern>
</filter-mapping>

Everything served by your container gets the filter executed first.

HTH,

Jon

vf@nat wrote:
> i have the same problem. have you any response to this?
> 
> ----- Original Message ----- 
> From: "jakarta-pipon" <jakarta-pipon@interlap.com.ar>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Friday, April 04, 2003 4:02 PM
> Subject: sendRedirect using <jsp:include ...>
> 
> 
>>i'd like to add some http headers, common  for all pages, so i put them
>>inside a headers.jsp, included with <jsp:include page...>.
>>but by this way it does not put any http header.
>>the java generated file for the jsp put
>>
>>            // HTML // begin [file="/areas.jsp";from=(0,58);to=(1,0)]
>>                out.write("\r\n");
>>
>>            // end
>>            // HTML // begin [file="/areas.jsp";from=(1,31);to=(2,0)]
>>                out.write("\r\n");
>>and after those \r\n (finnishing the http headers) begins the code for
>>header.jsp
>>so how can i append http headers for the common behavior in all jsps?
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message