• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to return an xml document instead of jsp

 
Pete Neu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like this in your Action class:


--Nimchi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic