tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject RE: service() method called Twice when using creating response wi th MIME type application/x-shockwave-flash
Date Thu, 02 Jan 2003 13:27:48 GMT
I had the same problem with a .exe download and what I did was allowed
tomcat to serve the file from the filesystem so I didn't have to deal with
Range and other http features. Then I used a filter for my rules(custom
login, etc)

Charlie

> -----Original Message-----
> From: Bill Barker [mailto:wbarker@wilshire.com]
> Sent: Thursday, December 19, 2002 12:54 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: service() method called Twice when using 
> creating response
> with MIME type application/x-shockwave-flash
> 
> 
> I don't personally use flash, but yes, the Adobe Acrobat 
> plugin for MSIE
> does much the same thing.  This is partially due to the fact that the
> Flash/Adobe plugin wants to try and stream the content (by sending a
> 'Content-Range' header), and partially due to the fact that 
> MSIE is totally
> brain-dead when it comes to plugins.
> 
> The first move is to try and support 'Content-Range' in your Servlet.
> You'll still get multiple requests, but hopefully it won't 
> cost as much.  If
> this isn't practical for your application, and the data isn't 
> too big, you
> could try caching the data in the session so that 
> re-generating doesn't cost
> too much.
> 
> "Andrew Milkowski" <amilkowski@unicast.com> wrote in message
> news:BDEHIHNJKNJKHALOJOEIGEKBCLAA.amilkowski@unicast.com...
> > Using Apache Tomcat/4.1.12 deployment, following sample code in the
> servlet
> > used to demonstrate this behavior
> >
> > public void service (HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException {
> >
> > final BufferedOutputStream bufferedOutputStream = new
> > BufferedOutputStream(response.getOutputStream(), 2048);
> >
> > ..
> > ..
> > ..
> >
> > response.setContentType("application/x-shockwave-flash");
> >
> > schart.encodeAsSWF(bufferedOutputStream);  // (schart here 
> is a carting
> > package that encodes swf file into the OutputStream)
> >
> >
> > response.setHeader("Expires", "-1");
> > response.setHeader("nPragma", "no-cache");
> >
> > bufferedOutputStream.flush();
> > bufferedOutputStream.close();
> >
> > response.flushBuffer();
> > }
> >
> > in the above service method gets called twice, before 
> rendering browser
> > output with the Flash MIME content!
> >
> > Did anyone here had a similar experience? (maybe not 
> necessarily with a
> > application/x-shockwave-flash) where service
> > method is called twice before completing response..
> >
> > Any suggestions/solutions greatly appreciated!
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:tomcat-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message