Using getParameterMap() with Tomcat 4.1 [message #188930] |
Thu, 01 March 2007 23:04  |
Eclipse User |
|
|
|
Originally posted by: sharper3.austin.dot.rr.dot.com
I have a servlet with a doPost method that retrieves the parameter set with
the HttpServletRequest.getParameterMap() method. This seems to work ok, until
I try to make any manipulations to the map, e.g. the map.remove(Object key)
method.
Apparently, because I am running in Tomcat 4.1, the above call actually
returns an org.apache.catalina.util.ParameterMap object, which has added
locking (see
http://tomcat.apache.org/tomcat-4.
0-doc/catalina/docs/api/org/apache/catalina/util/ParameterMa p.html).
This bothers me a little, because it might tie my implementation to the Tomcat
platform. But I could probably live with it, temporarily anyway.
However, I can't actually use that object because the default set of Tomcat
4.1 libraries in my project don't include it. I tried manually adding
${CATALINA_HOME}\server\libs\catalina.jar to my project. That works to
resolve the compile time issue, but at run time I still can't find the class.
I've tried copying the ParameterMap to another Map object (HashMap) that I can
manipulate with the remove method, but it still seems to think it is a
ParameterMap.
Does anyone have any suggestions or pointers?
scott
|
|
|
Re: Using getParameterMap() with Tomcat 4.1 [message #189017 is a reply to message #188930] |
Fri, 02 March 2007 20:00  |
Eclipse User |
|
|
|
The servlet spec says getParameterMap returns an immutable Map, so
modification of that map is not allowed. It's not clear what "it" was
that still thought it was a ParameterMap after copying, so I can't say
what the copy problem might be.
Cheers,
Larry
Scott Harper wrote:
> I have a servlet with a doPost method that retrieves the parameter set with
> the HttpServletRequest.getParameterMap() method. This seems to work ok, until
> I try to make any manipulations to the map, e.g. the map.remove(Object key)
> method.
>
> Apparently, because I am running in Tomcat 4.1, the above call actually
> returns an org.apache.catalina.util.ParameterMap object, which has added
> locking (see
> http://tomcat.apache.org/tomcat-4.
> 0-doc/catalina/docs/api/org/apache/catalina/util/ParameterMa p.html).
>
> This bothers me a little, because it might tie my implementation to the Tomcat
> platform. But I could probably live with it, temporarily anyway.
>
> However, I can't actually use that object because the default set of Tomcat
> 4.1 libraries in my project don't include it. I tried manually adding
> ${CATALINA_HOME}\server\libs\catalina.jar to my project. That works to
> resolve the compile time issue, but at run time I still can't find the class.
>
> I've tried copying the ParameterMap to another Map object (HashMap) that I can
> manipulate with the remove method, but it still seems to think it is a
> ParameterMap.
>
> Does anyone have any suggestions or pointers?
>
>
> scott
|
|
|
Powered by
FUDForum. Page generated in 0.02595 seconds