Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generate pdf and display on browser when clicked on link

 
farheen rabiya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI

Iam using struts 1.1 to generate a pdf report.
I have written the following code in my action class




And now when the user clicks on the link, pdf report should be generated in a new window.
which is what Iam not able to get.Iam getting errorr here.
Can someone help me what should be written in struts-config.xml file and what should be the url which on clicking should be giving the pdf.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam getting errorr here.

It'd be handy to state *what* error you're getting.

Window creation is handled by the browser, not the server. Are you opening the link in a new window? What's happening when you click the link?
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
farheen please Use Code Tags when you post a source code. You can edit your message using button and then add code tags to it...
 
farheen rabiya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

@David
Iam getting "writer already obtained" errorr.
Iam using velocity template (front end) where my link is present.And on click of that link a pdf report should be generated in a new window.

@Ankit
Iam new to this site and so I dont know how this has to be done.

My problem is I cannot use execute method,even then,when Iam using execute method and returning null,its not working.
I dont understand what should the url be like?
Please help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic