You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Davanum Srinivas <di...@yahoo.com> on 2000/09/21 15:11:09 UTC
Internet Explorer & PDF (via Cocoon, FOP)
Hi all,
Am unable to view PDF's under IE-5.5. The following "trick" works under IE-5.01 but fails under
IE-5.5. Basically Internet Explorer starts to open the page but never starts the Acroreader
plug-in. Though i can Right mouse click, save it as a PDF and view it without problem.
Any insights?
Thanks,
dims
------------------------------------------------------
instead of
http://host:port/cocoon/samples/fo/test-fo.xml
try this ( "?" after the link)
http://host:port/cocoon/samples/fo/test-fo.xml?
Jimmy Orendt
-----Urspr�ngliche Nachricht-----
Von: Doug Serres [mailto:dserres@netscape.net]
Gesendet am: Dienstag, 21. M�rz 2000 19:53
An: Cocoon Users
Betreff: Internet Explorer & PDF (via Cocoon, FOP)
When I try to run the http://host:port/cocoon/samples/fo/test-fo.xml example
Internet Explorer starts to open the page but never starts the Acroreader
plug-in. Netscape opens the plug-in ad displays the page just fine.
Has anyone else seen this behaviour?
I.E. 5.01
Windows 95b
Acroreader 4.05
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
XSP and multiple SQL queries
Posted by Benjamin Dixon <be...@arches.uga.edu>.
All,
Is it possible to have more than one query in a single XSP page?
And if so, how are the results from the first query related to the second
query? I need to make two queries but the data I'm selecting in one query,
relies on the other so I need to be able to match them up somehow.
Ben
Re: Internet Explorer & PDF (via Cocoon, FOP)
Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 21 Sep 2000, Davanum Srinivas wrote:
> Hi all,
>
> Am unable to view PDF's under IE-5.5. The following "trick" works under IE-5.01 but fails under
> IE-5.5. Basically Internet Explorer starts to open the page but never starts the Acroreader
> plug-in. Though i can Right mouse click, save it as a PDF and view it without problem.
>
> Any insights?
yeah, use an extension other than .xml, say, ie5sucxml. internet explorer
evilly ignores the mime-type header in favor of the file
extension. boooooo, boooooooo.
- donald
RE: Internet Explorer & PDF (via Cocoon, FOP)
Posted by Russ White <ru...@earthlink.net>.
The problem (on explorer anyway) is the when ie sees a url that ends with
.xml it assumes text/xml mime type.
The following servlet fixes the fop pdf problem on explorer 5.x and
netscape.
to use it simple map it with a name like "/pdf"
the invoke it like this /pdf?doc=documentName (no .xml extension here!)
the servlet then looks for a url documentName.xml to grab and return to the
client.
G'day!
Russ
Servlet code follows:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.net.*;
/**
* A simple servlet that tests inderict loading of a PDF file generated by
* Cocoon and FOP.
*
* This servlet is intended to address the problems many people have had
* displaying their FOP genrated PDF files on Explorer 5.x and Netscape 4.7X
*/
public class PdfServlet extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
doGet(request,response);
}
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
response.setHeader("Cache-Control", "no-cache, post-check=0,
pre-check=0");
String agent = request.getHeader("User-Agent").toLowerCase();
// netscape chokes on Pragma no-cahe so only send it to explorer
if (agent.indexOf("explorer") > -1){
response.setHeader("Pragma", "no-cache");
}
response.setHeader("Expires", "Thu, 01 Dec 1994 16:00:00 GMT");
String spec = "";
String protocol = "http://";
if (request.isSecure()) protocol = "https://";
String server = request.getServerName();
int port = request.getServerPort();
String doc = request.getParameter("doc");
// I add the xml extension dynamically because Explorer gets confused by
// xml extension because the crappy Microsoft developers neglected
proper
// use of mime types.
doc += ".xml";
// making sure the servlet works with https.
if (port != 80) spec = protocol+server+port+"/"+doc;
else spec = protocol+server+"/"+doc;
// hard coded content type for pdf to test this could be a property or
parm
response.setContentType("application/pdf");
URL url = new URL(spec);
InputStream in = url.openStream();
OutputStream out = response.getOutputStream();
int i;
while ((i = in.read()) > -1) {
out.write(i);
}
in.close();
out.flush();
out.close();
}
}>
> -----Original Message-----
> From: Davanum Srinivas [mailto:dims@yahoo.com]
> Sent: Thursday, September 21, 2000 9:11 AM
> To: cocoon-users@xml.apache.org
> Subject: Internet Explorer & PDF (via Cocoon, FOP)
>
>
> Hi all,
>
> Am unable to view PDF's under IE-5.5. The following "trick" works
> under IE-5.01 but fails under
> IE-5.5. Basically Internet Explorer starts to open the page but
> never starts the Acroreader
> plug-in. Though i can Right mouse click, save it as a PDF and
> view it without problem.
>
> Any insights?
>
> Thanks,
> dims
>
> ------------------------------------------------------
> instead of
> http://host:port/cocoon/samples/fo/test-fo.xml
> try this ( "?" after the link)
> http://host:port/cocoon/samples/fo/test-fo.xml?
>
> Jimmy Orendt
>
> -----Ursprüngliche Nachricht-----
> Von: Doug Serres [mailto:dserres@netscape.net]
> Gesendet am: Dienstag, 21. März 2000 19:53
> An: Cocoon Users
> Betreff: Internet Explorer & PDF (via Cocoon, FOP)
>
>
> When I try to run the
> http://host:port/cocoon/samples/fo/test-fo.xml example
> Internet Explorer starts to open the page but never starts the Acroreader
> plug-in. Netscape opens the plug-in ad displays the page just fine.
>
>
> Has anyone else seen this behaviour?
>
>
> I.E. 5.01
> Windows 95b
> Acroreader 4.05
>
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>