• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

creating pdf,xml,doc file using servlet

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My question is that, in my application there is some data which can be converted into pdf,xml and doc format?
What do you reccomend that either i use xsl/xslt and xsl-fo or use third party tools for converting the data into desire format?and could i use crystal report for this purpose?
Please give me the best practices for generating different format files for client using jsp/servlets
thanks and best regards.
Faisal Ishaque
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. If you want PDF's and they aren't difficult reports, I'd check out IText for creating them. It has Java Classes for creating PDFs. If you want to transform your XML into HTML, use XSLT. I don't know much about Crystal Reports class, but We use Crystal with our VB applications and it is handy.
Mark
 
faisal ishaque
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for giving me the helpfull suggestions...
Also tell me the performance issues using xsl/xslt/xsl-fo and third part tools?
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a good question. Performance seemed adequate in the couple of stuff that I have done. It is as usual, internet time.
Mark
 
Ranch Hand
Posts: 427
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dynamically Creating PDFs in a Web Application
http://www.onjava.com/pub/a/onjava/2003/06/18/dynamic_files.html
iText (Java PDF library)
http://www.lowagie.com/iText/
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use a cache to store pre-compiled XSL documents performance decrease is negligable (especially seen in the light of the typical runtime of a medium sized JSP or servlet, throw in some EJB calls and you will never even notice) after the first request that adds the compiled XSL to the cache.
I've successfully used code like the following (this is a rough draft of a version I'm working for for an upcoming new project):

as the doPost method of a servlet. 'cache' is a simple HashMap that's declared static to the servlet.
Calling entities pass a Document object and the name of an XSL stylesheet (which are assumed to be stored in /WEB-INF/xsl here).
Using similar code written for an earlier version of Xalan I clocked transformation times of 2-5 milliseconds for quite complex XSL stylesheets (with compilation taking 300 or so milliseconds, illustrating the need for caching).
About half this code is actually concerned with errorchecking, using an HTML template to generate an HTML output to display errors on the fly.
[ December 01, 2003: Message edited by: Jeroen Wenting ]
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi faisal,
if you want to include the Model-View-Controller pattern in your application design check out StrutsCX to generate your XML or PDF output. StrutsCX is an extension to the Apache Struts framework for use with XSLT - as alternative to JSP. It includes Apache's FOP.
http://it.cappuccinonet.com/strutscx
Regards,
Bernhard Woehrlin
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic