You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2003/12/17 17:52:52 UTC
DO NOT REPLY [Bug 25594] New: -
StreamGenerator can't handle multipart request parameters correctly
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: dev@cocoon.apache.org
ReportedBy: grizzly@gmx.at
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 "org.apache.cocoon.servlet.multipart.PartInMemory@4711" 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