Re: Workaround for IE "streamer bug"?

2003-10-30 Thread barantes
This header currently works for me in a similar case. Try changing your 
code:

response.setHeader("Content-Disposition", "attachment; filename=\"" + 
filename + "\"");

HTH.
 
Atenciosamente,
Bruno Arantes de Andrade Bueno
Webdeveloper Pleno

Fone: +55 (34) 3231-1073
Solution WEB - Soluções Para Internet!
www.solutionweb.com.br





Bjørn T Johansen <[EMAIL PROTECTED]>
10/30/2003 07:05 AM
Please respond to "Struts Users Mailing List"

 
To: Struts Users Mailing List <[EMAIL PROTECTED]>
cc: 
Subject:Workaround for IE "streamer bug"?


I have a little problem. I am using the following code to stream pdf
files to the browser..:

fis = new FileInputStream(filename);
  byte[] buf = new byte[fis.available()];

  response.setHeader("Content-Disposition", "inline;filename=" +
filename + ";");
  response.setContentType("application/pdf");
  response.setHeader("Connection", "keep-alive");
  response.setContentLength(buf.length);
  response.getOutputStream().write(buf,0,fis.read(buf));
  response.getOutputStream().flush();
  response.getOutputStream().close();
  fis.close();

This works ok in all browsers except for IE. When using IE, a dialog box
asking the user for which application to open the file in, is always
displayed. Why? And is there a workaround for this?


Thanks...

BTJ


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





[newbie] Problem subclassing TilesRequestProcessor

2003-10-20 Thread barantes
Hello to all!
I'm trying to subclass the TilesRequestProcessor in order to have a 
customized RequestProcessor and to support tiles in my web application, 
but the following error is showing int the browser when I call my test 
action:
java.lang.ClassCastException
 at 
org.apache.struts.tiles.TilesRequestProcessor.initDefinitionsMapping(TilesRequestProcessor.java:126)
 at 
org.apache.struts.tiles.TilesRequestProcessor.init(TilesRequestProcessor.java:116)
 at 
com.ctbc.sispro.web.PropostasRequestProcessor.init(Unknown Source)
 at 
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:872)
 at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

I'm using Struts 1.1 with Tomcat 4.1.18-LE. Below is the code for my 
CustomRequestProcessor and the controller part of my struts-config.xml. I 
have already searched the Struts Users List archive for messages about 
this, but found no help.
I hope you can help me.
Thanks in advance.
Bruno.
// Customized request processor
public class CustomRequestProcessor extends TilesRequestProcessor {
  public void init(ActionServlet servlet, ModuleConfig moduleConfig) 
throws javax.servlet.ServletException {
super.init(servlet, moduleConfig);
initDefinitionsMapping();
  }

}

// Controller part of the struts-config.xml