This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes PDF download Using Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "PDF download Using Struts" Watch "PDF download Using Struts" New topic
Author

PDF download Using Struts

Mithuna Logesh
Greenhorn

Joined: Feb 10, 2011
Posts: 2
Hi All ,

I am using struts to download a PDF file thro action classes . In the same action class I am having two methods to open the PDF file based on a condition .The download is working fine from one action method and not from the other .I am getting the correct URL and file name in the logs , but file is not opening .I am totally confused about how to proceed further .My struts.xml goes like this :

<action name="PartnerRevenueAction"
class="com.tsystems.portal.common.commonactions.PartnerAction"
method="displayReportAction">

<result name="SUCCESS" type="stream">
<param name="inputName">inputStream</param>
<param name="contentType">application/pdf</param>
<param name="contentDisposition">${reportname}</param>
<param name="bufferSize">15097152</param>
</result>
</action>
<action name="PartnerBillsAction"
class="com.tsystems.portal.common.commonactions.PartnerAction"
method="displayInvoiceAction">

<result name="SUCCESS" type="stream">
<param name="inputName">inputStream</param>
<param name="contentType">application/pdf</param>
<param name="contentDisposition">${filename}</param>
<param name="bufferSize">15097152</param>
</result>
</action>

The download is working fine for the PartnerBillsAction but not the revenue .Could some one suggest me a point from where I can take this forward ??

Thanks & Regards ,
Mithuna
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
Solved or Not, if not, post your PDF creation, action class code.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: PDF download Using Struts
 
Similar Threads
Browser gets refreshed after file download in Struts2
download content is outputting to my browser not creating a download file
Delete file when the file downloaded.
struts2 result type stream problem
Download file issue