my dog learned polymorphism*
The moose likes Struts and the fly likes generating pdf from jsp 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 » Frameworks » Struts
Bookmark "generating pdf from jsp" Watch "generating pdf from jsp" New topic
Author

generating pdf from jsp

Swathi Ram
Greenhorn

Joined: Sep 18, 2007
Posts: 27
Hey all.....

I'm trying to figure out a way to generate a pdf file using struts 2. Does Struts facilitate this??
I came across some examples that used jasperreports........if anyone has info on this or any other suggestion or any sample code, please help.

Thankyou.
Swathi
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

Swathi,
Struts is just a framework. You need to plugin a library to generate the PDF like Jasper or iText (open source PDF generator)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Swathi Ram
Greenhorn

Joined: Sep 18, 2007
Posts: 27
I tried to implement the JasperReport to generate a pdf.

I created the template and action class and put the following action mapping in my struts.xml

<result-types>
<result-type name="jasper" class="org.apache.struts2.views.jasperreports.JasperReportsResult" />
</result-types>

<action name="myJasperTest" class="com.nursefinders.JasperAction">
<result name="success" type="jasper">
<param name="location">/jasper/jasper_output.jasper</param>
<param name="dataSource">myList</param>
<param name="format">PDF</param>
</result>
</action>

But I don't have jasperreports.JasperReportsResult in my org.apache.struts2.views. How do I get that???
Do I need to have any plugin for that? If so which one?

Thanks
Swathi.
 
Consider Paul's rocket mass heater.
 
subject: generating pdf from jsp
 
Similar Threads
how to manage two JSPs in singe JSP
need pdf for struts
pdf in new window
Generating PDF
Page is not redirected in struts