wood burning stoves 2.0*
The moose likes Struts and the fly likes How to return an xml document instead of jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to return an xml document instead of jsp" Watch "How to return an xml document instead of jsp" New topic
Author

How to return an xml document instead of jsp

Pete Neu
Ranch Hand

Joined: Feb 18, 2005
Posts: 86
Hello,

I would like the Action to return an xml document instead of jsp/html page.
In a normal servlet that's done like that

response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
StreamResult streamResult = new StreamResult(out);
.
.
and so on ...

What do I have do to make it happen in Struts?
If that does not work would it make sense to store the xml file on the filesystem and to provide a download?

cheers
Pete
Nimchi Yung
Ranch Hand

Joined: Jan 27, 2004
Posts: 71
Something like this in your Action class:


--Nimchi
 
Consider Paul's rocket mass heater.
 
subject: How to return an xml document instead of jsp
 
Similar Threads
How to return an object instance by JSP
Remove Indentation during Transformation
Getting length(no of bytes) of Dom document which is in memory
Generating !DOCTYPE tag for a Document
How to stream xml document to inputSource?