You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Chris Kimpton <ki...@yahoo.com> on 2001/12/18 17:55:55 UTC

https, jetspeed and turbine RawScreen's...

Hi,

This is probably a problem with my code, but just in case...

I have a turbine screen (extends RawScreen) that I use to return
documents, eg PDFs.  

The screen just connects to a document server and reads in the bytes
and writes them out to the servlet response.  This works fine for
normal/non-secure/port 80/http connections.

...but when I make tomcat run the portlet as a secure site, using
ssl, then IE gets an error downloading the document.  The rest of the
portlet seems to work fine through https.

Also, if I run the screen outside of jetspeed, just through turbine
with https - that also works too...

Also, if I use Opera to get the https document - it seems to be ok
too.

So, I guess (?) that there is something different with the headers
under Jetspeed - since the content seems ok with Opera.  This is the
line I am currently pursuing...

Anyone had anything similar - recognise a stupid mistake?

TIA,
Chris

=====
Need somewhere to Live in London? - Then go to http://freeflats.com

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: https, jetspeed and turbine RawScreen's...

Posted by Michael Sallman <ms...@pro-ns.net>.
Chris,

>Chris Kimpton wrote:
> 
> Could you provide some more detail on this solution, this seems like
> it might be my best option...
> 

I had to go back and look to see how I did it, it's been so long. :-)
I have a page that sends a request to a Turbine Screen, which returns a
PDF document based on parameters passed from the original page. The
checkbox sets the parameter "download".
If download is true, the content type gets set to a non-standard type,
and with that and no file extension for IE/Windows to use to try and
figure out the file type, IE is forced to download the file. 
Looking at my code (at the end of this email), I also seem to recall
that there was a problem with cacheing/not cacheing (which is why I
commented it out, I think).
Anyway, it seems to do the trick.

>I found out last night that I had the IE Security option "Do not save
>encrypted pages to disk" switched off - which I don't think is the
>default.  This seemed to allow the access to work in some cases. 
>Turning this on meant that even my standalone servlet no longer
>worked....

Yep, I could get it to work some of the time (just not 100% of the
time), which is why I didn't resort to some browser-detection script. I
figured I'd let them try it and if their configuration let them display
the PDF in IE, great. If not, then they could download it and open it up
themselves in Acrobat. Or use a different browser!

The Screen does:

	String download = data.getRequest().getParameter("download");
        String stmttype = data.getRequest().getParameter("type");
        if (stmttype == null || stmttype.equals("")) stmttype = "pdf";
 
        filename = filedir + aid + "." + stmttype;
        stmtfile = new File(filename);
        j = (int)stmtfile.length();
        filearray = new char[j];
 
        java.io.BufferedReader br = new java.io.BufferedReader(new   	
java.io.FileReader(filename));
        br.read(filearray);
          
        //data.getResponse().setHeader("Cache-Control", "no-store");
        //data.getResponse().setHeader("Pragma", "no-cache");
            
        if (download.equals("true")) 
	{
           data.getResponse().setContentType("application/fidelity");
        } else  data.getResponse().setContentType("application/pdf");


Mike

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: https, jetspeed and turbine RawScreen's...

Posted by Chris Kimpton <ki...@yahoo.com>.
Hi,

--- Michael Sallman <ms...@pro-ns.net> wrote:
> Chris,
> I have been trying to do the same thing (for over a year now), and
> I had
> come to the conclusion that it's a problem with IE (I've only tried
> it
> through Jetspeed, though).
> In trying to research the problem, I've run across a lot of similar
> problems which led me to that conclusion (problems with IE/PDF,
> Content
> headers vs. file extensions, problems with IE and https). Never the
> exact same problem, but similar.
> I finally resorted to adding a check-box to my page that would
> force IE
> to download the file, instead of trying to display it.

Could you provide some more detail on this solution, this seems like
it might be my best option...

> I'm sure there's a way to make it work correctly, I just got tired
> of
> fighting it.
> If you do figure it out, let me know :-)

I found out last night that I had the IE Security option "Do not save
encrypted pages to disk" switched off - which I don't think is the
default.  This seemed to allow the access to work in some cases. 
Turning this on meant that even my standalone servlet no longer
worked....

Thanks,
Chris

> 
> Mike
> 
> Chris Kimpton wrote:
> > 
> > Hi,
> > 
> > This is probably a problem with my code, but just in case...
> > 
> > I have a turbine screen (extends RawScreen) that I use to return
> > documents, eg PDFs.
> > 
> > The screen just connects to a document server and reads in the
> bytes
> > and writes them out to the servlet response.  This works fine for
> > normal/non-secure/port 80/http connections.
> > 
> > ....but when I make tomcat run the portlet as a secure site,
> using
> > ssl, then IE gets an error downloading the document.  The rest of
> the
> > portlet seems to work fine through https.
> > 
> > Also, if I run the screen outside of jetspeed, just through
> turbine
> > with https - that also works too...
> > 
> > Also, if I use Opera to get the https document - it seems to be
> ok
> > too.
> > 
> > So, I guess (?) that there is something different with the
> headers
> > under Jetspeed - since the content seems ok with Opera.  This is
> the
> > line I am currently pursuing...
> > 
> > Anyone had anything similar - recognise a stupid mistake?
> > 
> > TIA,
> > Chris
> > 
> > =====
> > Need somewhere to Live in London? - Then go to
> http://freeflats.com
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Check out Yahoo! Shopping and Yahoo! Auctions for all of
> > your unique holiday gifts! Buy at http://shopping.yahoo.com
> > or bid at http://auctions.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


=====
Need somewhere to Live in London? - Then go to http://freeflats.com

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: https, jetspeed and turbine RawScreen's...

Posted by Michael Sallman <ms...@pro-ns.net>.
Chris,
I have been trying to do the same thing (for over a year now), and I had
come to the conclusion that it's a problem with IE (I've only tried it
through Jetspeed, though).
In trying to research the problem, I've run across a lot of similar
problems which led me to that conclusion (problems with IE/PDF, Content
headers vs. file extensions, problems with IE and https). Never the
exact same problem, but similar.
I finally resorted to adding a check-box to my page that would force IE
to download the file, instead of trying to display it.
I'm sure there's a way to make it work correctly, I just got tired of
fighting it.
If you do figure it out, let me know :-)

Mike

Chris Kimpton wrote:
> 
> Hi,
> 
> This is probably a problem with my code, but just in case...
> 
> I have a turbine screen (extends RawScreen) that I use to return
> documents, eg PDFs.
> 
> The screen just connects to a document server and reads in the bytes
> and writes them out to the servlet response.  This works fine for
> normal/non-secure/port 80/http connections.
> 
> ....but when I make tomcat run the portlet as a secure site, using
> ssl, then IE gets an error downloading the document.  The rest of the
> portlet seems to work fine through https.
> 
> Also, if I run the screen outside of jetspeed, just through turbine
> with https - that also works too...
> 
> Also, if I use Opera to get the https document - it seems to be ok
> too.
> 
> So, I guess (?) that there is something different with the headers
> under Jetspeed - since the content seems ok with Opera.  This is the
> line I am currently pursuing...
> 
> Anyone had anything similar - recognise a stupid mistake?
> 
> TIA,
> Chris
> 
> =====
> Need somewhere to Live in London? - Then go to http://freeflats.com
> 
> __________________________________________________
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for all of
> your unique holiday gifts! Buy at http://shopping.yahoo.com
> or bid at http://auctions.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>