File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Transforming Servlet Response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Transforming Servlet Response" Watch "Transforming Servlet Response" New topic
Author

Transforming Servlet Response

Lenin_Tony
Greenhorn

Joined: Sep 23, 2003
Posts: 9
Hi,
I want to transform a response from a servlet from XML ( the reply from the servlet display XML on my web browser ) to HTML using XSLT. How do I capture the response from a servlet to transform it? I am relatively new to servlet so forgive ignorance.
Eelco den Heijer
Ranch Hand

Joined: Jan 17, 2002
Posts: 61
The most elegant solution is to use a filter that processes the outcome of the service method of you servlet, and transforms the XML to HTML. You could also build a simple XSLTHelper that you invoke at the end of your service method. There are numerous examples on both filters and how to do an XSL transformation from a servlet (do a Google search, or check the tutorials on java.sun.com)


== <br />Rgrds,<br />Eelco<br /> <br />SCJP, SCJD, SCBCD, SCWD, SCEA
 
jQuery in Action, 2nd edition
 
subject: Transforming Servlet Response
 
Similar Threads
Servlet Response for AJAX
Servlet returning an XML
filter objects
HELP!!! XML,XSLT!!!!!!!
getWriter() has already been called for this response