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/generation JspGenerator.java
Date Wed, 22 Oct 2003 20:31:19 GMT
joerg       2003/10/22 13:31:19

  Modified:    src/blocks/jsp/java/org/apache/cocoon/generation
                        JspGenerator.java
  Log:
  *argh* this file should not be committed, so reverting changes (back to 1.7)
  
  Revision  Changes    Path
  1.9       +11 -30    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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JspGenerator.java	22 Oct 2003 20:26:22 -0000	1.8
  +++ JspGenerator.java	22 Oct 2003 20:31:19 -0000	1.9
  @@ -50,27 +50,24 @@
   */
   package org.apache.cocoon.generation;
   
  -import java.io.ByteArrayInputStream;
  -import java.io.IOException;
  -
  -import javax.servlet.ServletContext;
  -import javax.servlet.ServletException;
  -import javax.servlet.http.HttpServletRequest;
  -import javax.servlet.http.HttpServletResponse;
  -
   import org.apache.avalon.framework.component.Component;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.jsp.JSPEngine;
  -import org.apache.cocoon.components.source.SourceUtil;
  +import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.http.HttpEnvironment;
  -import org.apache.excalibur.source.Source;
  -import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.xml.sax.SAXParser;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
  +import javax.servlet.ServletContext;
  +import javax.servlet.ServletException;
  +import javax.servlet.http.HttpServletRequest;
  +import javax.servlet.http.HttpServletResponse;
  +import java.io.ByteArrayInputStream;
  +import java.io.IOException;
  +
   /**
  - * Allows JSP to be used as a generator. Builds upon the JSP servlet
  + * Allows JSP to be used as a generator.  Builds upon the JSP servlet
    * functionality - overrides the output method in order to pipe the
    * results into SAX events.
    *
  @@ -79,8 +76,6 @@
    */
   public class JspGenerator extends ServletGenerator {
   
  -    protected String jspEncoding = null;
  -
       /**
        * Generate XML data from JSP.
        */
  @@ -101,16 +96,6 @@
           JSPEngine engine = null;
           SAXParser parser = null;
           try {
  -            Source inputSource = null;
  -            try {
  -                inputSource = super.resolver.resolveURI(this.source);
  -                inputSource.getURI();
  -            } catch (SourceException se) {
  -                throw SourceUtil.handle("Error during resolving of '" + this.source + "'.",
se);
  -            } finally {
  -                super.resolver.release(inputSource);
  -            }
  -            
               // TODO (KP): Should we exclude not supported protocols, say 'context'?
               String url = this.source;
               // absolute path is processed as is
  @@ -118,12 +103,8 @@
                   // get current request path
                   String servletPath = httpRequest.getServletPath();
                   // remove sitemap URI part
  -                String sitemapURI = this.request.getSitemapURI();
  -                if (servletPath.indexOf(sitemapURI) != -1) {
  -                    servletPath = servletPath.substring(0, servletPath.indexOf(sitemapURI));
  -                } else {
  -                    servletPath = servletPath.substring(0, servletPath.lastIndexOf("/")
+ 1);
  -                }
  +                String sitemapURI = ObjectModelHelper.getRequest(objectModel).getSitemapURI();
  +                servletPath = servletPath.substring(0, servletPath.indexOf(sitemapURI));
                   url = servletPath + url;
               }
   
  
  
  

Mime
View raw message