Well,...

If you already have the PDF generated, why not directly write it to the response(and 
in this way to the browser)? 

To fulfill your use case as described.
Your action generates the PDF and caches it somewhere. Then it will forward to the 
JSP-File containing the message and the link. This link either points to a 
Struts-Action or a plain servlet. This target-Servlet (or Action) retrieves the cached 
PDF and sends it to the browser.
Where to cache?
a) File-System
 - you need a writable location and remember to install some cleaning mechanism
 - the link presented could be just the reference to the cached file if that directory
   readable by the webserver
b) user-session
 - dangerous in a clustered environment (too much stuff to propagate around)
 - memory usage (usually the recommendation is not to use more than 4K in session...)
 - PDF only available to original user
 - easy to program
c) separate cache
 - adds another component to your app (DO NOT roll your own cache, there are quite a 
   number of tested cache-libraries)
 - could make the PDF available also to other users (depends on the use-case and the 
   cache-library)

hope this helps
Alexander


-----Original Message-----
From: Otto, Frank [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 03, 2004 9:18 AM
To: '[EMAIL PROTECTED]'
Subject: struts and iText

Hi,
 
I have generated a pdf with iText. In my action class I want to write it in the 
response object.
 
The result should be a jsp-page with content "pdf generated successful" and a link to 
this pdf. The pdf should be shown in a new browser window too.
 
Has someone do this? How can I do this?
 

kind regards,
 
frank

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to