wood burning stoves 2.0*
The moose likes JSP and the fly likes jsp to xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp to xml" Watch "jsp to xml" New topic
Author

jsp to xml

Richard Elsberry
Ranch Hand

Joined: Mar 14, 2001
Posts: 40
Hello,
Am having a hard time researching this one. I am currently using a jsp page with imbedded jsp's to display data from a database as html in a browser.
I would like to be able to convert the output to xml as well for additional processing but cannot figure out how to do that conversion on the fly.
My ultimate goal is to apply an xsl-fo style sheet to display the web page in a pdf document as well.
Has anybody come across this situation? I feel that once I can get the generated html page as a DOM it should be easy to use FOP for pdf display. Any thoughts or suggestions would be greatly appreciated.
Regards,
Richard
Djamel Djemaoun
Greenhorn

Joined: Apr 08, 2002
Posts: 4
Originally posted by Richard Elsberry:
Hello,
Am having a hard time researching this one. I am currently using a jsp page with imbedded jsp's to display data from a database as html in a browser.
I would like to be able to convert the output to xml as well for additional processing but cannot figure out how to do that conversion on the fly.
My ultimate goal is to apply an xsl-fo style sheet to display the web page in a pdf document as well.
Has anybody come across this situation? I feel that once I can get the generated html page as a DOM it should be easy to use FOP for pdf display. Any thoughts or suggestions would be greatly appreciated.
Regards,
Richard

--------------------------------------------------
To convert the output of JSP page to xml:
1- You have to be sure that the JSP page content is text/xml adding:
<%@ page contentType="text/xml"%>
2- You have to notify the JSP page which the xslt file should be used to process transformation like
<?xml:stylesheet type="text/xsl"
href="file.xsl"
version="1.0"
encoding="UTF-8"?>


_ _______________________ _ <br />Software Designer/Developer<br />Eng., B.Sc., PhD
Richard Elsberry
Ranch Hand

Joined: Mar 14, 2001
Posts: 40
Djamel,
Thanks for you response. I would like to have the jsp file output to html as it already does. However, I would also like to convert a copy of the dynmaic output to another file for processing. I have been trying to figure out a way to do this but have not had much luck.
Richard
Edward Brode
Greenhorn

Joined: Apr 30, 2002
Posts: 11
It sounds like you are trying to get two outputs from the the same page at the same time, which I don't think can be done. You might want to have two different versions of the page with different outputs, the pages being reached by different URLs, or have essentially two different versions of the same page both on the same physical page with a parameter determining which part of the page is generating the output.
[ May 20, 2002: Message edited by: Edward Brode ]

Edward Brode<br />SCJP2<p>"It works on my machine"<br /> - Paul Symonds
Naveen Sydney
Ranch Hand

Joined: Jan 21, 2002
Posts: 30
try using the same page but change the content-type based on a url parameter.
river down
Greenhorn

Joined: Dec 11, 2002
Posts: 21
Any info in converting this html to a pdf...any idea, tool ? and how it works..please advise...
Say I want to convert this html to PDF upon a submit button is click...?
Thanks
Jeya Balaji
Ranch Hand

Joined: Jan 02, 2003
Posts: 40
You might be able to get a copy of the html if you use filters.
Filters are java code which sit in between the request/response and jsp/servlet. So, by using this filter mech, u should be able to create a xml doc on the fly.
(I haven't worked with filters; just theoritical knowledge. Pls explore in that area).
Regards,
Balaji
[ January 30, 2003: Message edited by: Jeya Balaji ]

Regards, Balaji
Ramesh Bhagasra
Greenhorn

Joined: Nov 21, 2003
Posts: 8
hi there i m trying very hard to display the contents of a pdf file whcih is stored in my oracle table as a blob field, but i m not able to stream it out through response object. i have tried everything..plzzzz help me out...
Steve Olson
Greenhorn

Joined: Dec 04, 2003
Posts: 7
Your are in luck ... checkout www.faceless.org ... they have a HTML to PDF servlet that converts well formatted HTML to PDF. I used this on a project and had good success with it.
Grab the PDF library.
http://big.faceless.org/products/download.jsp
--
steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp to xml
 
Similar Threads
JSP & PDF's
How to make PDF render to handle HTML specific?
HTML to PDF possible?
Escape HTML characters - what's the good practice?
Jsp to Pdf file using Apache Fop