struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "El Harouchi, Jaafar [IT]" <jaafar.elharou...@citigroup.com>
Subject RESOLVED RE: Path Info for downloaded files
Date Thu, 19 Jun 2003 15:35:57 GMT
We resolved the download issue by first doing:
	response.reset();
I would still be interested in how to set the Path Info.
thanks,
jaafar

-----Original Message-----
From: El Harouchi, Jaafar [IT] 
Sent: Thursday, June 19, 2003 1:01 AM
To: struts-user@jakarta.apache.org
Subject: Path Info for downloaded files


Hi,
I've been trying to get generated PDF and CSV files to be downloaed by my actions but can't
get it to work in IE using HTTP 1.0 when my app is behind the corporate portal.  It works
when accessed directly through the app (but not when I try to reach the action by putting
the full url).

I'm using all the tricks I could find:
      Setting ContentType:  response.setContentType("application/pdf");
      Setting the ContentDisposition: response.setHeader("Content-Disposition", "attachment;
filename=file.pdf";
      Adding  8192 bytes to be sure that IE shows the document: ostream.write(new byte[8192]);
      /Setting contentlength: response.setContentLength(data.length+8192);
      // Flush the buffer:  response.flushBuffer();

It works in Netscape 4.7, Netscape 6.
Since IE is the problem and our corporate standard i have to try setting the Path Info, instead
on relying on the content disposition.

So how would you set the path info if you have your actions mapped as follows:
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/action/*</url-pattern>
  </servlet-mapping>
and configured as follows:
       <action path="/dailyReports"
                type="com.ssmb.fipb.primedirect.web.reports.DailyReportAction"
                name="reportForm"
                parameter="dispatchMethod"
                scope="request">
                <forward name="next"
                         path="/jsp/dailyReports_cv.jsp"
                         redirect="false"/>
        </action>
These are dispatch actions anf the url is something like:
http://.../action/dailyReports
If I change it to GET from POST it would be:
http://.../action/dailyReports?dispatchMethod=retrieve&reportRequest.reportIds=RDQQPB77&reportRequest.format=pdf&reportRequest.mgmtGroupNumber=51555&reportRequest.actMnemonic=XPBALC

Where would the path info go?
If I add it in between action/file.pdf/dailyReports the mapping fails and my action is not
invoked.
If I add it at the very end &test/file.pdf I get the same stupid IE error after it prompts
you to open/save.

Any ideas would be greatly appreciate it.

Sorry if it is a little incoherent but we really understimated our effort and have had to
work looong hours.

thanks a lot
-jaafar

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message