aspose file tools
The moose likes Struts and the fly likes Dynamically setting the contentType in Struts. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Dynamically setting the contentType in Struts." Watch "Dynamically setting the contentType in Struts." New topic
Author

Dynamically setting the contentType in Struts.

Tim Eyre
Greenhorn

Joined: May 20, 2002
Posts: 20
Does anyone know how I dynamically set the contentType of a page? I want to give my users the option of seeing their results as an excel spreadsheet, or in HTML format. Effectively I want to do:

But this will always run the report in Excel. I'm sure I need to set the contentType first and then dispatch the request, but am unsure how to do this in Struts.
Any ideas?
Thanks
Tim
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Dynamically setting the contentType in Struts.
 
Similar Threads
Setting content Type in JSP
The IE and Netscape conflict again!! :-)
Reporting in XLS format
JSP to Excel spreadsheetS
How to output JSP page to Excel ?