Again, I'll point out that Tomcat's Request class is not designed properly
for extension and offer these two proposed solutions, both of which would
need to be implemented in core Tomcat source code by Tomcat developers:

1) Let users specify the fully-qualified name of a Request subclass in
server.xml, then instantiate that class any time a Request object is needed. 
Maybe something like this:

<Request class="com.whatever.MyRequestSubclass" />

Internally, there could be a RequestFactory that any client could get a new
Request object from.  It would either instantiate Request directly if no
<Request> element was specified in server.xml, or instaniate a Request
subclass if one was specified.

2) Provide a copy constructor in the Request class so that Request can be
properly subclassed and any Valve can wrap the Request instance passed-in to
the invoke() method with an instance of the subclass to pass downstream. 
This is the constructor that would be needed:

public Request(Request request)

This constructor would copy all of the passed-in request's state into its
own state, so that this new Request instance can be used further down the
pipeline exactly as the passed-in request would have been.

Thanks,
Zach



Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Zach,
> 
> Zach Cox wrote:
> | Hi Matthias - Unfortunately I think the Response class is just as
> ill-suited
> | for wrapping/extending as the Request class is.  Which boggles my mind -
> | isn't wrapping the Request and/or Response one of the primary intended
> | usages of Filters & Valves?
> 
> Filters, yes. Apparently, not Valves :(
> 
> I wonder if the Tomcat devs would accept a patch to change this.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkgR3IUACgkQ9CaO5/Lv0PAKGwCfYGKXcA0VEKLLkp2ilAnlYy/E
> rtwAoKCxanMCJbnW/zG3wd16254bnWX/
> =1HA0
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Share-session-cookie-across-subdomains-tp16787390p16898364.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to