struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric SCHULTZ <>
Subject RE: Dynamic page contentType
Date Mon, 10 Nov 2003 03:48:38 GMT
Good afternoon...

Sorry, I'm new to Struts so I need a bit more context than that.

Do use the method below in my Action object?  And then use different
Forwards depending on whether the result is to be in HTML or XML?  Or do I
check in the JSP what my content-type is set to and output the correct


-----Original Message-----
From: Adam Hardy []
Sent: November 8, 2003 9:15 AM
To: Struts Users Mailing List
Subject: Re: Dynamic page contentType

On 11/07/2003 10:16 PM Eric SCHULTZ wrote:
> I'm developing an application in Struts that outputs primarily XML; but in
> some instances I need it to output HTML of the same ActionForms and
> Is there a way I can change the page forwarded in the Forward depending on
> some flag or property?!
> Or is there someway I can set the JSP to output text/html or text/xml
> depending on some flag or property (and obviously generate the correct
> section based on the flag)?

response.setHeader("Content-type", "text/xml");

struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message