You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by gcj <ga...@comcast.net> on 2008/10/19 02:06:55 UTC

Download PDF File in Internet Explorer w/SSL

Struts Users,

 

Despite the numerous posts/suggestions I have read/implemented on the
subject, I am not able to download or display existing PDF files from my SSL
struts/tomcat application using Internet Explorer.

 

Safari and Firefox work fine.  Unfortunately it is not an option for me to
tell my users not to use IE.

 

The DownloadAction example/workarounds as provided by
<http://wiki.apache.org/struts/ServingPdfDocuments>
http://wiki.apache.org/struts/ServingPdfDocuments didn't work for me either.
I haven't been able to link to the files as HREFs, either.  For example:

 

<html:link href="files/pdfs/myFile.pdf">My File</html:link>

 

I don't have an entry for "nocache" in the controller element of my
struts-config file.  Adding the nocache parameter with a value of false had
no effect.

 

Any suggestions would be greatly appreciated.

 

Struts Version:              1.2.9

Tomcat Version:            6.0.14

Java Version:                1.6.0_05-b13

IE Version:                    7.0.6000.16757


Re: Download PDF File in Internet Explorer w/SSL

Posted by Roger <ro...@googlemail.com>.
On Sunday 19 October 2008 04:55:31 Wendy Smoak wrote:
> On Sat, Oct 18, 2008 at 5:06 PM, gcj <ga...@comcast.net> wrote:
> > Despite the numerous posts/suggestions I have read/implemented on the
> > subject, I am not able to download or display existing PDF files from my
> > SSL struts/tomcat application using Internet Explorer.
>
> What did you do, and what happened?  Without a description of the
> error it's hard to help.
>
> Your post initially reminded me of a problem I had long ago serving PDFs...
>
> Internet Explorer has a problem displaying non-HTML content over SSL
> as the result of a form POST.  In short, you have to send IE some HTML
> before you send it the bytes of the PDF, or it will complain.
>

There also is/was an issue with .pdf in IE if you didn't set the content 
length before trying to send it,

Regards


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


Maven2 archetype:generate, Struts 2

Posted by Jishnu Viswanath <ji...@tavant.com>.
Hi,
	I don't know weather this thing should come in here or not, any
way I was experimenting with maven2, 

When I gave mvn archetype:generate, I got a list,

I took the best suited me, Struts 2, Hibernate and Spring :)

3: internal -> appfuse-basic-struts (AppFuse archetype for creating a
web application with Hibernate, Spring and Struts 2)

It created without any problem,
Well when you start the server, I used the inbuild jetty server, mvn
jetty:run 

It gave me exception saying xfire-servlet.xml is not found,  ok when I
checked the WEB-INF, 2 xmls where not generated security.xml &
xfire-servlet.xml, Ok I created empty bean xml's No bean named
'springSecurityFilterChain' is defined, Well when I checked in web xml
there is a filter defined with class
org.springframework.web.filter.DelegatingFilterProxy which takes
springSecurityFilterChain, I tried to do add that but I am getting
Invocation Target Exception.


http://forum.springframework.org/showthread.php?p=207143#post207143
Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE
Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may 
contain confidential and/or privileged material. If you have received this in error, please contact the 
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies 
may be subject to our monitoring procedures.


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


RE: Download PDF File in Internet Explorer w/SSL

Posted by gcj <ga...@comcast.net>.
After doing some additional searching, I found out it is not a Struts issue,
but a Tomcat issue.  Specifically, how Tomcat appends cache control headers
when running under a secure context (SSL).

Although this isn't a problem for Safari or Firefox, it is a problem with
Internet Explorer because it prevents the user from downloading
(saving/caching) files via SSL.

See the link below for more information:

http://marc.info/?l=tomcat-user&m=111811136603781&w=2

The solution that worked for me was to add the following response headers in
my action class that extends org.apache.struts.actions.DownloadAction:

response.setHeader("Cache-Control", "cache");
response.setHeader("Pragma", "cache");
response.setHeader("Content-Disposition", "attachment;filename=" +fileName);

My struts-config action looks like this:

<action path="/filetransfer"
type="com.myproject.actions.SSLFileDownloadAction"/>

My struts link looks like this:

<html:link action="filetransfer?file=myPDF.pdf">My PDF</html:link>

Some great examples of how to implement the struts download action can be
found here:

http://wiki.apache.org/struts/StrutsFileDownload

Thanks for the suggestions/help.

-----Original Message-----
From: Wendy Smoak [mailto:wsmoak@gmail.com] 
Sent: Saturday, October 18, 2008 7:56 PM
To: Struts Users Mailing List
Subject: Re: Download PDF File in Internet Explorer w/SSL

On Sat, Oct 18, 2008 at 5:06 PM, gcj <ga...@comcast.net> wrote:

> Despite the numerous posts/suggestions I have read/implemented on the
> subject, I am not able to download or display existing PDF files from my
SSL
> struts/tomcat application using Internet Explorer.

What did you do, and what happened?  Without a description of the
error it's hard to help.

Your post initially reminded me of a problem I had long ago serving PDFs...

Internet Explorer has a problem displaying non-HTML content over SSL
as the result of a form POST.  In short, you have to send IE some HTML
before you send it the bytes of the PDF, or it will complain.

If that sounds like it, I have a very old wiki page on the topic...
http://wiki.wsmoak.net/cgi-bin/wiki.pl?NonsecureContent

(But then later you say a plain link didn't work either, so maybe not.)

-- 
Wendy

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


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


Re: Download PDF File in Internet Explorer w/SSL

Posted by Wendy Smoak <ws...@gmail.com>.
On Sat, Oct 18, 2008 at 5:06 PM, gcj <ga...@comcast.net> wrote:

> Despite the numerous posts/suggestions I have read/implemented on the
> subject, I am not able to download or display existing PDF files from my SSL
> struts/tomcat application using Internet Explorer.

What did you do, and what happened?  Without a description of the
error it's hard to help.

Your post initially reminded me of a problem I had long ago serving PDFs...

Internet Explorer has a problem displaying non-HTML content over SSL
as the result of a form POST.  In short, you have to send IE some HTML
before you send it the bytes of the PDF, or it will complain.

If that sounds like it, I have a very old wiki page on the topic...
http://wiki.wsmoak.net/cgi-bin/wiki.pl?NonsecureContent

(But then later you say a plain link didn't work either, so maybe not.)

-- 
Wendy

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


Re: Download PDF File in Internet Explorer w/SSL

Posted by Dave Newton <ne...@yahoo.com>.
--- On Sat, 10/18/08, gcj wrote:
> <html:link href="files/pdfs/myFile.pdf">My File</html:link>

How can that not work? What happens? If the link is being generated correctly then it's unlikely that it's a Struts issue. Have you tried any IE forums?

Dave


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