• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml FOP and jsp

 
raul manzano
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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??
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic