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 7510] New: - Error in Multipart request handler
Date Wed, 27 Mar 2002 12:37:44 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=7510>.
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=7510

Error in Multipart request handler

           Summary: Error in Multipart request handler
           Product: Cocoon 2
           Version: 2.0.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: core
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: j.tervoorde@home.nl


There's a bug in 
org/apache/cocoon/components/request/multipart/MultipartRequestWrapper.java:

In String[] getParameterValues(String name) the method value.toArray is used
causing in a ClassCastException in Cocoon.java when a multipart/form-data form is 
posted.

Here's a replacement for the method:

    /**
     * Method getParameterValues
     *
     * @param name
     *
     * @return
     */
    public String[] getParameterValues(String name) {

        if (values != null) {
            Object value = get(name);

            if (value != null) {
                if (value instanceof Vector) {
			String[] results = new String[((Vector)value).size()];
			for (int i=0;i<((Vector)value).size();i++) {
				results[i] = ((Vector)value).elementAt(i).toString
();
			}
			return results;

                } else {
                    return new String[]{value.toString()};
                }
            }

            return null;
        } else {
            return request.getParameterValues(name);
        }
    }

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


Mime
View raw message