This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

generate pdf and display on browser when clicked on link

 
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.
 
Author
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?
 
Sheriff
Posts: 9643
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • 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.
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!