tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikita Tovstoles <>
Subject cannot copy Request parameters to Map while load testing
Date Mon, 08 May 2006 16:40:23 GMT

I'm load-testing my webapp running on Tomcat 5.5.12 (Win) using the 
following URL:


In doGet() I have this line:

Map<String, String[]> _requestParams = (Map<String, 

In load-testing, Most of the time this requests processes normally, but 
in about 2% of cases I see that:
_requestParams.containsKey("cmd") == false.
As the matter of fact, in those cases _requestParams.size()==0 !

However, in all cases request.getParameter("cmd") returns "test", as 
expected. So, for some reason, 2% of the time _requestParams gets 
assigned a 0-size map, even though a parameter is present. I am really 
puzzled - could someone please suggest why this may be happening as well 
is how can I work around this? (Let's assume I *do* need to end up with 
a Map<String, String[]>


PS. Here's my code until the line in question:

public void doGet(HttpServletRequest request, HttpServletResponse 
response) throws IOException{
    Map<String, String[]> _requestParams = (Map<String, 

        //if(! _requestParams.containsKey("cmd")) { //this fails 2% of 
the time
       String  _command = request.getParameter("cmd"); //this never fails
        if(_command == null) {
            this.getLogger().warning("Invalid request: 
            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Did 
not understand your request");

    //other stuff

    private void printParamMap(Map<String, String[]> paramMap) {
        this.getLogger().info("ParamMap key size: 
        for(String key : paramMap.keySet()) {

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message