This is actually pretty cool in concept!  Have you used it?

Cheers!
Mark

----- Original Message -----
From: "Gennis Emerson" <[EMAIL PROTECTED]>
Sent: Wednesday, October 17, 2001 7:19 PM


> You might be able to do something container-specific - cast the
> ServletRequest to some container implementation class which gives
> you access to a setter. I haven't investigated that.
>
> The only way I could see, using the API, was to extend
> HttpServletRequestWrapper and override the parameter methods. If
> you know that your added parameter name won't ever conflict with
> any of the original request parameters (or any added during an
> include or forward), I think it can be fairly straightfoward.  If
> you want to merge values, you have to do a little more work.
>
> Here's a version of one of the methods; the others are even more
> straightforward.
>
>     public Map getParameterMap()
>     {
>         Map parentMap = super.getParameterMap();
>         if (parentMap.size() == 0 && mParameters.size() == 0)
>             return Collections.EMPTY_MAP;
>         if (parentMap.size() == 0)
>             return Collections.unmodifiableMap(mParameters);
>         if (mParameters.size() == 0)
>             return parentMap;
>
>         Map paramMap = new HashMap(parentMap);
>         paramMap.putAll(mParameters);
>         return Collections.unmodifiableMap(paramMap);
>     }
>
>
> Gennis

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to