tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Krogemann <>
Subject Re: Using custom CoyoteResponse(Facade)
Date Fri, 17 Sep 2004 13:38:36 GMT
Thanks Yoav, Martin, Tim

You're right, ServletApi's Filter appears to be a simple solution. I 
somehow didn't expect that I could just do something like:

	response = new ResponseWrapper(response)

in the doFilter method, but of course it works, because the wrapper is 
just passed on to the next elements in the chain, I guess.

Our design is not that nice, I know. I would much prefer to use only one 
tomcat but that is unfortunately not an option right now and sessions 
will have to be maintained independently on both servers.

Tim: What are these valves you mentioned?

Thanks again,

Shapira, Yoav wrote:

> Hi,
> Why not use an HttpServletResponseWrapper?  You can easily wrap whatever
> responses you want with a Filter, and then implement the encodeURL
> method however you want.
> I think the design itself is cruising for a bruising, as is the case any
> time you deviate from Servlet Spec mandates on session tracking, but I
> imagine you already know that and have no choice.
> Yoav Shapira
> Millennium Research Informatics
>>-----Original Message-----
>>From: Markus Krogemann []
>>Sent: Friday, September 17, 2004 8:32 AM
>>To: Tomcat Users List
>>Subject: Using custom CoyoteResponse(Facade)
>>Dear List,
>>I am having a hard time to figure out how I could fulfill a special
>>requirement in a current project.
>>I could use either tomcat 4.1.x or tomcat 5.0.x for this project, I
>>presume it doesn't make much difference in terms of possible solutions.
>>The project also uses struts (1.2.2) and here is the special
>>requirement: Instead of encoding URLs with "our" tomcat's session Id I
>>have to use the session Id from another server to encode the URL, since
>>all URLs first call that other server which then includes stuff from
>>"our" tomcat. Hope that description was clear ...
>>Anyway, what I would like to do is somehow "smuggle" a response object
>>into a request/response pair that could then have it's own encodeURL
>>implementation. I don't really want to patch tomcat if possible and I
>>also don't want to extend many struts classes which would be another
>>solution. Anyone got an idea?
>>I have tried to use dynamic proxies (creating proxies for
>>CoyoteResponseFacade objects) but that didn't appear to work (invoke
>>would not get called on the proxies).
>>I also had a look at the option to wrap my own implementation of
>>HttpServletResponse around the CoyoteResponseFacade, but that also
>>didn't get me very far. I was hoping that the .setResponse method of
>>CoyoteRequest could help, but I cannot get to a CoyoteRequest object,
>>only to a CoyoteRequestFacade object. Hm ...
>>If all else fails, I guess I will have to patch tomcat.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message