cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/webapp sitemap.xmap
Date Tue, 10 Jul 2001 12:30:52 GMT
dims        01/07/10 05:30:51

  Modified:    src/org/apache/cocoon/generation Tag: cocoon_20_branch
                        JspGenerator.java
               webapp   Tag: cocoon_20_branch sitemap.xmap
  Log:
  Added a parameter for JspGenerator for specifying the JspServlet class name.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.3   +23 -3     xml-cocoon2/src/org/apache/cocoon/generation/JspGenerator.java
  
  Index: JspGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/JspGenerator.java,v
  retrieving revision 1.6.2.2
  retrieving revision 1.6.2.3
  diff -u -r1.6.2.2 -r1.6.2.3
  --- JspGenerator.java	2001/07/07 19:08:16	1.6.2.2
  +++ JspGenerator.java	2001/07/10 12:30:41	1.6.2.3
  @@ -30,6 +30,9 @@
   import javax.servlet.http.HttpServletResponse;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.parser.Parser;
  @@ -47,12 +50,29 @@
    * results into SAX events.
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.6.2.2 $ $Date: 2001/07/07 19:08:16 $
  + * @version CVS $Revision: 1.6.2.3 $ $Date: 2001/07/10 12:30:41 $
    */
  -public class JspGenerator extends ServletGenerator implements Recyclable {
  +public class JspGenerator extends ServletGenerator implements Recyclable, Configurable
{
   
  +    /** The Servlet Include Path */
       public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
   
  +    /** The Default Servlet Class Name for Tomcat 3.X and 4.X*/
  +    public static final String DEFAULT_SERVLET_CLASS = "org.apache.jasper.servlet.JspServlet";
  +
  +    /** Servlet Class Name */
  +    public String jspServletClass = DEFAULT_SERVLET_CLASS;
  +
  +    public void configure(Configuration conf) throws ConfigurationException
  +    {
  +        if (conf != null)
  +        {
  +            Configuration child = conf.getChild("jsp-servlet-class");
  +            this.jspServletClass = child.getValue(DEFAULT_SERVLET_CLASS);
  +            getLogger().debug("JspServlet class is " + this.jspServletClass);
  +        }
  +    }
  +
       /**
        * Generate XML data from JSP.
        */
  @@ -73,7 +93,7 @@
               MyServletResponse response = new MyServletResponse(httpResponse);
   
               // start JSPServlet.
  -            Class clazz = Thread.currentThread().getContextClassLoader().loadClass("org.apache.jasper.servlet.JspServlet");
  +            Class clazz = Thread.currentThread().getContextClassLoader().loadClass(this.jspServletClass);
               HttpServlet jsp = (HttpServlet) clazz.newInstance();
               jsp.init(new config((ServletContext)this.objectModel.get(HttpEnvironment.HTTP_SERVLET_CONTEXT)));
               jsp.service(request, response);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.11 +3 -1      xml-cocoon2/webapp/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
  retrieving revision 1.11.2.10
  retrieving revision 1.11.2.11
  diff -u -r1.11.2.10 -r1.11.2.11
  --- sitemap.xmap	2001/07/10 10:51:11	1.11.2.10
  +++ sitemap.xmap	2001/07/10 12:30:48	1.11.2.11
  @@ -16,7 +16,9 @@
      <map:generator  name="script"      src="org.apache.cocoon.generation.ScriptGenerator"/>
      <map:generator  name="velocity"    src="org.apache.cocoon.generation.VelocityGenerator"/>
      <map:generator  name="html"        src="org.apache.cocoon.generation.HTMLGenerator"
label="content"/>
  -   <map:generator  name="jsp"         src="org.apache.cocoon.generation.JspGenerator"/>
  +   <map:generator  name="jsp"         src="org.apache.cocoon.generation.JspGenerator">
  +    <jsp-servlet-class>org.apache.jasper.servlet.JspServlet</jsp-servlet-class>

  +   </map:generator>
      <map:generator  name="stream"      src="org.apache.cocoon.generation.StreamGenerator"/>
     </map:generators>
   
  
  
  

----------------------------------------------------------------------
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


Mime
View raw message