Re: how to manipulate static content

2007-07-05 Thread lior grinfeld
Thanks Pierre, for sure i will use that info, but now i am not writing a server, as i wrote earlier, i use tomcat to test a proxy. i am interested to see how my proxy behave when i send it the data chunked or zip the data. and i want this to be in reference to regular files. so basically all i

Re: how to manipulate static content

2007-07-05 Thread lior grinfeld
Thanks Pierre, for sure i will use that info, but now i am not writing a server, as i wrote earlier, i use tomcat to test a proxy. i am interested to see how my proxy behave when i send it the data chunked or zip the data. and i want this to be in reference to regular files. so basically all i

Re: how to manipulate static content

2007-07-05 Thread Girish Havaldar
Hi, we have an application developed using the following components as listed below mysql 5.0.27 jdk 1.5.0_06 jre 1.5.0_06 tomcat5.5.20 Apache 2 phpMyAdmin 2.9.2 Servlets 2.3 JSP1.2 Our application is

Re: how to manipulate static content

2007-07-05 Thread David Delbecq
The easiest way is to subclass HttpServletResponseWrapper. Override the methods 'getOutputStream' and 'getWriter()' (not sure getWriter is really used by static content serving, so you may not have to code something there). Basically, make a ByteArrayOutputStream as the result of getOutputStream,

Re: how to manipulate static content

2007-07-04 Thread David Delbecq
Either map to '/*' your custom servlet that returning the static content with your custom headers, either write a servletfilter that add additional header before processing request. En l'instant précis du 04/07/07 09:52, lior grinfeld s'exprimait en ces termes: Hi, i am new at using tomcat. I

Re: how to manipulate static content

2007-07-04 Thread lior grinfeld
Thanks for the tip, i used filters. now i facing other problem. if I use filter with request to static content ( i did not write servlet for it , i want the defaultServlet to handle it) for some reason i do not get the content, it looks like the defaultServlet is doing nothing now, without

Re: how to manipulate static content

2007-07-04 Thread David Delbecq
Could it be you forgot to call filterChain.doFilter(request.response) after adding your headers? En l'instant précis du 04/07/07 14:18, lior grinfeld s'exprimait en ces termes: Thanks for the tip, i used filters. now i facing other problem. if I use filter with request to static content ( i

Re: how to manipulate static content

2007-07-04 Thread lior grinfeld
you were right, 10X. now i am facing yet one more challenge. i made filter to overwrite the response, i added headers as i want and it works fine. now i want to manipulate the content , to do zip or to chunk the data. i tried to do StreamResponseWrapper that extends HttpServletResponseWrapper,

Re: how to manipulate static content

2007-07-04 Thread Pierre Goupil
Lior, Basically, I think that you need to handle the response by yourself. For instance, if you want to send an image : *** RenderedImage rimg = ImageIO.read(new File(img)); OutputStream os = response.getOutputStream(); // === get the response to be able to re-write it