You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2002/03/20 21:37:48 UTC
cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation StreamGenerator.java
vgritsenko 02/03/20 12:37:48
Modified: src/java/org/apache/cocoon/generation StreamGenerator.java
Log:
Fix bug #6947
Revision Changes Path
1.8 +6 -5 xml-cocoon2/src/java/org/apache/cocoon/generation/StreamGenerator.java
Index: StreamGenerator.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/StreamGenerator.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StreamGenerator.java 22 Feb 2002 07:03:51 -0000 1.7
+++ StreamGenerator.java 20 Mar 2002 20:37:48 -0000 1.8
@@ -85,7 +85,7 @@
* number of bytes read is equal to the getContentLength() value.
*
* @author <a href="mailto:Kinga_Dziembowski@hp.com">Kinga Dziembowski</a>
- * @version CVS $Id: StreamGenerator.java,v 1.7 2002/02/22 07:03:51 cziegeler Exp $
+ * @version CVS $Id: StreamGenerator.java,v 1.8 2002/03/20 20:37:48 vgritsenko Exp $
*/
public class StreamGenerator extends ComposerGenerator
{
@@ -119,18 +119,19 @@
String parameter = parameters.getParameter(StreamGenerator.FORM_NAME, null);
int len = 0;
String contentType = null;
- try
- {
+ try {
HttpServletRequest request = (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
contentType = request.getContentType();
- if (contentType.startsWith("application/x-www-form-urlencoded")) {
+ if (contentType == null) {
+ throw new IOException("Requred header ContentType is missing.");
+ } else if (contentType.startsWith("application/x-www-form-urlencoded")) {
String sXml = request.getParameter(parameter);
inputSource = new InputSource(new StringReader(sXml));
} else if (contentType.startsWith("text/plain") ||
contentType.startsWith("text/xml") ||
contentType.startsWith("application/xml")) {
- len = request.getContentLength();
+ len = request.getContentLength();
if (len > 0) {
PostInputStream anStream = new PostInputStream(request.getInputStream(), len);
inputSource = new InputSource(anStream);
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org