Tim,

With the functionality you desire, stay away from the Session classes as defined in the servlet API.

I completely agree.


Instead, look into Filters and HttpServletRequestWrapper and HttpServletResponse wrapper.

Ideally, you'd create some helper classes which do the gets and sets on the servletrequests and responses. How they get instantiated is up to you.

Yeah, the filter is the way to go. A Filter gets to execute both before and after your "application" code handles the request.


You can do some clever things like gather all the cookies from a request that match a certain pattern (regexp), convert them to objects, and shove them into request attribute (or perhaps a Map of name->value, with the whole map in the request). Then, have your app code handle the request.

After your app code executes, look for an attribute in the request (since response objects, unfortunately for your, can't have attributes) that should be converted back into cookies.

Let me know if you need some sample code. This seems interesting enough that I'd be willing to bang some simple stuff out for you :)

-chris


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



Reply via email to