cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 8277] New: - org.apache.cocoon.environment.http.HttpRequest.decode nullpointer excetion
Date Thu, 18 Apr 2002 21:19:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8277>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8277

org.apache.cocoon.environment.http.HttpRequest.decode nullpointer excetion

           Summary: org.apache.cocoon.environment.http.HttpRequest.decode
                    nullpointer excetion
           Product: Cocoon 2
           Version: 2.0.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: core
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: mauch@imkenberg.de


I set encodeing of the request to utf-8 using:
ObjectModelHelper.getRequest(map).setCharacterEncoding("utf-8");

if i try to retrive a empty parameter i go a nullpointer exception:
java.lang.NullPointerException
<kabir>  at org.apache.cocoon.environment.http.HttpRequest.decode
(HttpRequest.java:300)
<kabir>  at org.apache.cocoon.environment.http.HttpRequest.getParameter
(HttpRequest.java:293

I found a problem in:
org.apache.cocoon.environment.http.HttpRequest.decode 

the str parameter is not checked for the null value, so the line

byte[] bytes = str.getBytes(this.container_encoding);

produces the exception.

A possible solution is to add as first line:
 if(str== null) return null;
and everything works fine

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message