Jim Collins wrote:

Hi,

Has anyone any thoughts on this?



The "header" object relates to the *request* headers. You can set *response* headers in a number of ways:

* (Servlet 2.3 or later) in a Filter that wraps and postprocesses
 the response

* In your Action (although that only works if you also do the output
 itself; doing a request dispatcher forward will clear the headers).

* In a JSP page with scriptlets (as long as it's before the response
 is committed):

 <%
   response.setHeader("Foo", "bar");
 %>

* In a JSP page with HTML <meta> tags in the <head> section:

<meta http-equiv="Foo" content="bar">

* (JSP 2.0 or later) you can use EL expressions to get the value part
 of the header from a bean property dynamically:

<meta http-equiv="Foo" content="${mybean.fooValue}">

* Ugly but workable using a Struts tag get the dynamic value:

 <meta http-equiv="Foo"
  content='<bean:write name="mybean" property="fooValue"/>'>

 This only works because <meta> is not a custom tag; otherwise
 the nesting syntax would be illegal.

Thanks

Jim.



Craig



----- Original Message ----- From: "Jim Collins" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, April 06, 2004 10:10 PM
Subject: Slightly OT How to set a request header using JSTL





Hi,

I know how I can read request headers using c:out and the header object.
Does anyone know how I can set a response header using c:set? Can it be


done


without using the response tag? I don't want to use scriptlets.

Thanks

Jim.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to