You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by hub <fe...@abacus.ch> on 2009/10/19 19:47:55 UTC

serveResource() question

Hi,

1.

Problem:
In doView() I want to display a PDF form. I call
response.createResourceURL() and expect that my serveResource() function
will be called, but this does not happen -- i get a blank page (there is no
other output). The created resource URL is OK, if I copy/paste it to the
browser, my serveResource() is called and the PDF is displayed.
Question:
How do I achieve to display a PDF as response to a RenderRequest ?

Thank you
Hubert

-- 
View this message in context: http://www.nabble.com/serveResource%28%29-question-tp25962607p25962607.html
Sent from the Pluto - Dev mailing list archive at Nabble.com.


Re: serveResource() question

Posted by hub <fe...@abacus.ch>.
in doView()

response.setContentType("text/html"); 
PrintWriter writer = response.getWriter(); 
ResourceURL resURL = response.createResourceURL(); 
String p = "<object data=\"" + resURL.toString() + "\"" +
"type=\"application/pdf\" width=\"100%\" height=\"100%\""; 
writer.print(p); 

serveResource() is called then.

This works for IE and firefox but.... 
in IE without problems, in firefox I get a Stacktrace although I get the
document in the browser, but sometimes firefox also crashes 

Does someone perhaps have a clue? 
Thank you 
Hubert 

17:55:47,953 ERROR [[WorkflowPortlet]] Servlet.service() for servlet
WorkflowPortlet threw exception 
java.net.SocketException: Connection reset by peer: socket write error 
at java.net.SocketOutputStream.socketWrite0(Native Method) 
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) 
at java.net.SocketOutputStream.write(SocketOutputStream.java:136) 

-- 
View this message in context: http://www.nabble.com/serveResource%28%29-question-tp25962607p26029560.html
Sent from the Pluto - Dev mailing list archive at Nabble.com.