• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to clear response ?

 
baran tamer
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
Is it possible to clear the http response ?
I want to clear the response and return an XML as my response , how can i do that ?

Thanks
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HttpServletResponse API provides you the reset() method for this. The only prerequisitie is that it shouldn't be committed yet, otherwise you will face an IllegalStateException.
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSF is a useful and powerful framework, but there's no benefit in using it where it's a bad fit. After all, JSF also carries a lot of overhead. And there's no need for each and every page that comes out of a JSF app to be a JSF page - JSF is a helper, not a controller.

Rather than kludge out something to make JSF emit XML, consider simply creating an XML JSP (jspx). Remember, there's nothing magic about backing beans - a backing bean with session scope is just another session scope JavaBean. So you can access it using the normal session object methods in a servlet, JSP or even Struts action just as easily as you can from a JSF page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!