You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/01/20 10:20:34 UTC

DO NOT REPLY [Bug 33175] New: - When two or more Content-Type is received, getParameter returns null.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33175

           Summary: When two or more Content-Type is received, getParameter
                    returns null.
           Product: Tomcat 4
           Version: 4.1.30
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Connector:Coyote HTTP/1.1
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: hayashin@ist.fujitsu.com


On tomcat 4.1.30 sometime ServletRequest#getParameter() method return null,
though POST is done from the FORM tag of correct HTML.
Content-Typte of HTTP header was the following at this time. 
-----------
POST ...
...
Content-Type: application/x-www-form-urlencoded, application/x-www-form-
urlencoded
...

key=value
-----------

It thinks this to be a bug of IE but all browsers cannot be replaced. 
There cannot be a thing that there are two or more values in Content-Type. 
It is possible to deal with this problem by selecting the one value. 
If it is possible, I want you to do as follows. 

org.apache.coyote.Request.java getContentType() method.
-----------
    public String getContentType() {
        contentType();
        if ((contentTypeMB == null) || contentTypeMB.isNull()) 
            return null;
        // ********** FIX FROM **********
        String orgContentType=contentTypeMB.toString();
        java.util.StringTokenizer ts=new java.util.StringTokenizer
(orgContentType,",");
        String lastContentType=ts.nextToken();
        while(ts.hasMoreTokens()){
        	lastContentType=ts.nextToken();
        }
        return lastContentType;
//      return contentTypeMB.toString();
        // ********** FIX TO **********
    }
-----------

regards,
Naru Hayashi

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org