Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Return XML Response from Action Class

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
I am building a web apps, where user need to hit URL which in turn calls an Action class . NOw this action class generate an XML file which i want to Dispaly to user as a response.

How should i do that ??
Any help,

Thanks in advance !
 
Praveen Sangolli
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sagar
You can do it this way, first of all return null from your action class and then get hold of the PrintWriter, and stuff the xml into it
for eg,

PrintWriter outres = response.getWriter();

outres.print("<response>Success</response>");
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats a great help Praveen ...

Thanks a lot !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic