cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/reading JSPReader.java
Date Thu, 20 Nov 2003 12:46:52 GMT
joerg       2003/11/20 04:46:52

  Modified:    src/blocks/jsp/java/org/apache/cocoon/generation
                        JspGenerator.java
               src/blocks/jsp/java/org/apache/cocoon/reading JSPReader.java
  Log:
  poor man's fix for using JSPs within aggregation and cocoon:
  
  Revision  Changes    Path
  1.10      +7 -2      cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/generation/JspGenerator.java
  
  Index: JspGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/generation/JspGenerator.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JspGenerator.java	22 Oct 2003 20:31:19 -0000	1.9
  +++ JspGenerator.java	20 Nov 2003 12:46:52 -0000	1.10
  @@ -104,7 +104,12 @@
                   String servletPath = httpRequest.getServletPath();
                   // remove sitemap URI part
                   String sitemapURI = ObjectModelHelper.getRequest(objectModel).getSitemapURI();
  -                servletPath = servletPath.substring(0, servletPath.indexOf(sitemapURI));
  +                if (sitemapURI != null) {
  +                    servletPath = servletPath.substring(0, servletPath.indexOf(sitemapURI));
  +                } else {
  +                    // for example when using cocoon:/ pseudo protocol
  +                    servletPath = servletPath.substring(0, servletPath.lastIndexOf("/")
+ 1);
  +                }
                   url = servletPath + url;
               }
   
  
  
  
  1.6       +7 -2      cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/reading/JSPReader.java
  
  Index: JSPReader.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/reading/JSPReader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JSPReader.java	4 Aug 2003 09:53:49 -0000	1.5
  +++ JSPReader.java	20 Nov 2003 12:46:52 -0000	1.6
  @@ -103,7 +103,12 @@
                   String servletPath = httpRequest.getServletPath();
                   // remove sitemap URI part
                   String sitemapURI = ObjectModelHelper.getRequest(objectModel).getSitemapURI();
  -                servletPath = servletPath.substring(0, servletPath.indexOf(sitemapURI));
  +                if (sitemapURI != null) {
  +                    servletPath = servletPath.substring(0, servletPath.indexOf(sitemapURI));
  +                } else {
  +                    // for example when using cocoon:/ pseudo protocol
  +                    servletPath = servletPath.substring(0, servletPath.lastIndexOf("/")
+ 1);
  +                }
                   url = servletPath + url;
               }
   
  
  
  

Mime
View raw message