cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r420959 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
Date Tue, 11 Jul 2006 19:38:33 GMT
Author: cziegeler
Date: Tue Jul 11 12:38:33 2006
New Revision: 420959

URL: http://svn.apache.org/viewvc?rev=420959&view=rev
Log:
Factor out uri detection to new utility class

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java?rev=420959&r1=420958&r2=420959&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java
Tue Jul 11 12:38:33 2006
@@ -118,43 +118,15 @@
         }
 
         // We got it... Process the request
-        String uri = request.getServletPath();
-        if (uri == null) {
-            uri = "";
-        }
-        String pathInfo = request.getPathInfo();
-        if (pathInfo != null) {
-            // VG: WebLogic fix: Both uri and pathInfo starts with '/'
-            // This problem exists only in WL6.1sp2, not in WL6.0sp2 or WL7.0b.
-            if (uri.length() > 0 && uri.charAt(0) == '/') {
-                uri = uri.substring(1);
-            }
-            uri += pathInfo;
-        }
-
-        if (uri.length() == 0) {
-            /* empty relative URI
-                 -> HTTP-redirect from /cocoon to /cocoon/ to avoid
-                    StringIndexOutOfBoundsException when calling
-                    "".charAt(0)
-               else process URI normally
-            */
-            String prefix = request.getRequestURI();
-            if (prefix == null) {
-                prefix = "";
-            }
-
-            res.sendRedirect(res.encodeRedirectURL(prefix + "/"));
+        final String uri = RequestUtil.getCompleteUri(request, res);
+        if ( uri == null ) {
+            // a redirect occured, so we are finished
             return;
         }
-
         String contentType = null;
 
         Environment env;
         try{
-            if (uri.charAt(0) == '/') {
-                uri = uri.substring(1);
-            }
             // Pass uri into environment without URLDecoding, as it is already decoded.
             env = getEnvironment(uri, request, res);
         } catch (Exception e) {



Mime
View raw message