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=25594>. 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=25594 StreamGenerator can't handle multipart request parameters correctly Summary: StreamGenerator can't handle multipart request parameters correctly Product: Cocoon 2 Version: Current CVS 2.2 Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: sitemap components AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] In the StreamGenerator class in line 140 String sXml = request.getParameter(parameter); inputSource = new InputSource(new StringReader(sXml)); it is wrongly assumed that in case of multipart requests the xml data can be retrieved via the normal request.getParameter() Method. In fact this code results in a sXml String containing something like "[EMAIL PROTECTED]" which is not the xml content and therefore cannot be parsed. Instead it should read like: Object xmlObject = request.get(parameter); Reader xmlReader = null; if (xmlObject instanceof String){ xmlReader = new StringReader((String) xmlObject); } else if (xmlObject instanceof Part){ xmlReader = new InputStreamReader(((Part) xmlObject).getInputStream()); } else{ throw new ProcessingException("Unknown request object encountred named " + parameter + " : " + xmlObject); } inputSource = new InputSource(xmlReader); thx, Gernot
