Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Using getParameterMap() with Tomcat 4.1
Using getParameterMap() with Tomcat 4.1 [message #188930] Thu, 01 March 2007 23:04 Go to next message
Eclipse UserFriend
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 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
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
Previous Topic:Random hangs with WTP 1.5.3
Next Topic:JSP validator - Undefined attribute name
Goto Forum:
  


Current Time: Thu Apr 25 10:24:53 GMT 2024

Powered by FUDForum. Page generated in 0.02504 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top