cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r581812 - /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
Date Thu, 04 Oct 2007 09:24:25 GMT
Author: lgawron
Date: Thu Oct  4 02:24:24 2007
New Revision: 581812

URL: http://svn.apache.org/viewvc?rev=581812&view=rev
Log:
ServletSource is not able to rerequest the data anyway. If some parts of cocoon code call
Source.getInputStream even though the Source.getValidity returned proper validity then a new
implementation of ServletSource has to be created.

Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java?rev=581812&r1=581811&r2=581812&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
Thu Oct  4 02:24:24 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -78,17 +78,10 @@
             connect();
             // FIXME: This is not the most elegant solution
             if (servletConnection.getResponseCode() != HttpServletResponse.SC_OK) {
-                //most probably, servlet returned 304 (not modified) and we need to perform
second request to get data
-
-                //
-                // FIXME This does not work: previous instance of servletConnection
-                //       most probably had non empty requestBody. Re-instantiating
-                //       it results in new servletConnection with null requestBody
-                //       and, as a result, GET request instead of POST.
-                //
-
-                servletConnection = new ServletConnection(location);
-                servletConnection.connect();
+                throw new ServletException("If you see this exception you probably called
Source.getInputStream"
+                        + " even though the source reported proper validity. "
+                        + "The only way to solve this is to implement "
+                        + "a resource heavy version of postable source.");
             }
 
             return this.servletConnection.getInputStream();



Mime
View raw message