aspose file tools*
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 Java 8 in Action this week in the Java 8 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to return an xml document instead of jsp
 
Similar Threads
Generating !DOCTYPE tag for a Document
How to return an object instance by JSP
How to stream xml document to inputSource?
Remove Indentation during Transformation
Getting length(no of bytes) of Dom document which is in memory