• 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

xml FOP and jsp

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any one knows how can i generate pdf from a jsp if the xml source is generate for another jsp??
can anyone help me?any source code of a example??
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by raul manzano:
any one knows how can i generate pdf from a jsp if the xml source is generate for another jsp??
can anyone help me?any source code of a example??


The Apache FOP package comes up with a example servlet(FopServlet.java), see the docs folder to get the source code. Its basically converts a given xml+xsl into a PDF or a give fo into a PDF.
If you want this to be done in a JSP, then you can better write a java bean for doing this server side process.
All you have to do is add the neccessary jar files in to the lib directory of your web apps and write the servlet or javabean.
The example code got everything to help you.
Hope this helps
Regards
Balaji
 
raul manzano
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my problen is that i dont have xml files, i have a xml source from a jsp .
How i do it ? examples?
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by raul manzano:
my problen is that i dont have xml files, i have a xml source from a jsp .
How i do it ? examples?


One temporary solution is to write the xml file into a temp location and give it as input to XSLTInputHandler.
If your xml is org.w3.dom.Document object, you can pass it to fop as is, please see Driver javadocumentation(API) in fop src distribution. it will help you.
A search in http://marc.theaimsgroup.com/?l=fop-user may also help you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic