You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Marcelo F. Ochoa" <mo...@ieee.org> on 2001/07/10 13:28:27 UTC

Re: [C2]: Planning beta 2 (Configurable JspGenerator which work with Oracle9iAS Containers for J2EE)

Hi all:
   Is there any simple way to modified the JspGenerator in order to 
accept a configuration parameter?
   It mean that JspGenerator accepts differents JspCompiler, for example:
   - com.evermind.server.http.JSPServlet (Oracle9iAS Containers for J2EE)
   - oracle.jsp.JspServlet (Oracle JSP 1.1)

  - com.prism.JspWrapper (DB Prism wrapper which integrates DB Prism 1.2.1 with Cocoon 2 framework)

   I am working with the last option and with a modified version (hard 
coded) of JspGenerator which has changed the lines:

             // start JSPServlet.
             Class clazz = 
Thread.currentThread().getContextClassLoader().loadClass("org.apache.jasper.servlet.JspServlet");
             HttpServlet jsp = (HttpServlet) clazz.newInstance();


with these lines:

             // start JSPServlet.
             Class clazz = 
Thread.currentThread().getContextClassLoader().loadClass("com.prism.JspWrapper");
             Servlet jsp = (Servlet) clazz.newInstance();

Note that, I am using Servlet class instead of HttpServlet because is 
higher in the level of inherency and it working with Oracle Object 
Container for Java (9 iAS).
In the other hand, I am working in document with five step to install 
and run Cocoon 2 with Oracle9iAS Containers for J2EE (OC4J) 
(http://technet.oracle.com/tech/java/oc4j/content.html) and I will sent 
it to this list.
Best regards, Marcelo.


-- 
Marcelo F. Ochoa - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press 
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2]: Planning beta 2 (Configurable JspGenerator which work with Oracle9iAS Containers for J2EE)

Posted by "Marcelo F. Ochoa" <mo...@ieee.org>.
Davanum Srinivas wrote:

>>
>>
> 
> Marcelo, 
> Do you have some time to do this?

  IMO using the interface javax.servlet.Servlet will be work for all cases.
  - "javax.servlet.http.HttpServlet" class extends 
javax.servlet.GenericServlet which implements javax.servlet.Servlet 
interface.
  - "com.evermind.server.http.JSPServlet" implements 
javax.servlet.Servlet interface.

 - "com.prism.JspWrapper" implements javax.servlet.Servlet interface.
 Then using:

...

import javax.servlet.Servlet;
...
            Class clazz = Thread.currentThread().getContextClassLoader().loadClass(this.jspServletClass);
            Servlet jsp = (Servlet) clazz.newInstance();
            jsp.init(new config((ServletContext)this.objectModel.get(HttpEnvironment.HTTP_SERVLET_CONTEXT)));
            jsp.service(request, response);
...
will be work ...
> 
> 
> Thanks,
> dims
> 
> 

  Many thanks in advance, Marcelo

-- 
Marcelo F. Ochoa - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press 
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2]: Planning beta 2 (Configurable JspGenerator which work with Oracle9iAS Containers for J2EE)

Posted by Davanum Srinivas <di...@yahoo.com>.
Please see below:

--- Giacomo Pati <gi...@apache.org> wrote:
> Quoting "Marcelo F. Ochoa" <mo...@ieee.org>:
> 
> > Hi all:
> >    Is there any simple way to modified the JspGenerator in order to 
> > accept a configuration parameter?
> 
> Yes, patch it to accept a Configuration/Parameters like any other component will
> ev. have Configuration/Parameters.

Giacomo, Marcelo,
Done. Checked-in to both 2.0 and 2.1 CVS.

> 
> >    It mean that JspGenerator accepts differents JspCompiler, for
> > example:
> >    - com.evermind.server.http.JSPServlet (Oracle9iAS Containers for
> > J2EE)
> >    - oracle.jsp.JspServlet (Oracle JSP 1.1)
> > 
> >   - com.prism.JspWrapper (DB Prism wrapper which integrates DB Prism
> > 1.2.1 with Cocoon 2 framework)
> > 
> >    I am working with the last option and with a modified version (hard 
> > coded) of JspGenerator which has changed the lines:
> > 
> >              // start JSPServlet.
> >              Class clazz = 
> >
>
Thread.currentThread().getContextClassLoader().loadClass("org.apache.jasper.servlet.JspServlet");
> >              HttpServlet jsp = (HttpServlet) clazz.newInstance();
> > 
> > 
> > with these lines:
> > 
> >              // start JSPServlet.
> >              Class clazz = 
> > Thread.currentThread().getContextClassLoader().loadClass("com.prism.JspWrapper");
> >              Servlet jsp = (Servlet) clazz.newInstance();
> 
> If all these HttpServlets/Servlets need to be abstracted then you should create
> an Avalon component put into cocoon.xconf to wrap those and let JspGenerator
> choose that component for the request.
> 

Marcelo, 
Do you have some time to do this?

> > 
> > Note that, I am using Servlet class instead of HttpServlet because is 
> > higher in the level of inherency and it working with Oracle Object 
> > Container for Java (9 iAS).
> > In the other hand, I am working in document with five step to install 
> > and run Cocoon 2 with Oracle9iAS Containers for J2EE (OC4J) 
> > (http://technet.oracle.com/tech/java/oc4j/content.html) and I will sent 
> > it to this list.
> > Best regards, Marcelo.


Thanks,
dims


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2]: Planning beta 2 (Configurable JspGenerator which work with Oracle9iAS Containers for J2EE)

Posted by Giacomo Pati <gi...@apache.org>.
Quoting "Marcelo F. Ochoa" <mo...@ieee.org>:

> Hi all:
>    Is there any simple way to modified the JspGenerator in order to 
> accept a configuration parameter?

Yes, patch it to accept a Configuration/Parameters like any other component will
ev. have Configuration/Parameters.

>    It mean that JspGenerator accepts differents JspCompiler, for
> example:
>    - com.evermind.server.http.JSPServlet (Oracle9iAS Containers for
> J2EE)
>    - oracle.jsp.JspServlet (Oracle JSP 1.1)
> 
>   - com.prism.JspWrapper (DB Prism wrapper which integrates DB Prism
> 1.2.1 with Cocoon 2 framework)
> 
>    I am working with the last option and with a modified version (hard 
> coded) of JspGenerator which has changed the lines:
> 
>              // start JSPServlet.
>              Class clazz = 
>
Thread.currentThread().getContextClassLoader().loadClass("org.apache.jasper.servlet.JspServlet");
>              HttpServlet jsp = (HttpServlet) clazz.newInstance();
> 
> 
> with these lines:
> 
>              // start JSPServlet.
>              Class clazz = 
> Thread.currentThread().getContextClassLoader().loadClass("com.prism.JspWrapper");
>              Servlet jsp = (Servlet) clazz.newInstance();

If all these HttpServlets/Servlets need to be abstracted then you should create
an Avalon component put into cocoon.xconf to wrap those and let JspGenerator
choose that component for the request.

Giacomo

> 
> Note that, I am using Servlet class instead of HttpServlet because is 
> higher in the level of inherency and it working with Oracle Object 
> Container for Java (9 iAS).
> In the other hand, I am working in document with five step to install 
> and run Cocoon 2 with Oracle9iAS Containers for J2EE (OC4J) 
> (http://technet.oracle.com/tech/java/oc4j/content.html) and I will sent 
> it to this list.
> Best regards, Marcelo.
> 
> 
> -- 
> Marcelo F. Ochoa - mochoa@ieee.org
> Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
> More info?
> Chapter 21 of the book "Professional XML Databases" (Wrox Press 
> http://www.wrox.com/)
> Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
> http://www.oreilly.com/catalog/oracleopen/)
> -----------------------------------------------
> Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
> Paraje Arroyo Seco - Campus Universitario
> (7000) Tandil - Bs. AS. - Argentina
> Te: +54-2293-444430 Fax: +54-2293-444431
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2]: Planning beta 2 (Configurable JspGenerator which work with Oracle9iAS Containers for J2EE)

Posted by Davanum Srinivas <di...@yahoo.com>.
Marcelo,

Please pick up the latest JspGenerator.java and sitemap.xmap from the CVS. You will find that you
can specify the Class Name as a parameter in the sitemap.xmap file. Please feel free to submit
patches and docs. It will be really helpful. 

Thanks,
dims

--- "Marcelo F. Ochoa" <mo...@ieee.org> wrote:
> Hi all:
>    Is there any simple way to modified the JspGenerator in order to 
> accept a configuration parameter?
>    It mean that JspGenerator accepts differents JspCompiler, for example:
>    - com.evermind.server.http.JSPServlet (Oracle9iAS Containers for J2EE)
>    - oracle.jsp.JspServlet (Oracle JSP 1.1)
> 
>   - com.prism.JspWrapper (DB Prism wrapper which integrates DB Prism 1.2.1 with Cocoon 2
> framework)
> 
>    I am working with the last option and with a modified version (hard 
> coded) of JspGenerator which has changed the lines:
> 
>              // start JSPServlet.
>              Class clazz = 
>
Thread.currentThread().getContextClassLoader().loadClass("org.apache.jasper.servlet.JspServlet");
>              HttpServlet jsp = (HttpServlet) clazz.newInstance();
> 
> 
> with these lines:
> 
>              // start JSPServlet.
>              Class clazz = 
> Thread.currentThread().getContextClassLoader().loadClass("com.prism.JspWrapper");
>              Servlet jsp = (Servlet) clazz.newInstance();
> 
> Note that, I am using Servlet class instead of HttpServlet because is 
> higher in the level of inherency and it working with Oracle Object 
> Container for Java (9 iAS).
> In the other hand, I am working in document with five step to install 
> and run Cocoon 2 with Oracle9iAS Containers for J2EE (OC4J) 
> (http://technet.oracle.com/tech/java/oc4j/content.html) and I will sent 
> it to this list.
> Best regards, Marcelo.
> 
> 
> -- 
> Marcelo F. Ochoa - mochoa@ieee.org
> Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
> More info?
> Chapter 21 of the book "Professional XML Databases" (Wrox Press 
> http://www.wrox.com/)
> Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
> http://www.oreilly.com/catalog/oracleopen/)
> -----------------------------------------------
> Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
> Paraje Arroyo Seco - Campus Universitario
> (7000) Tandil - Bs. AS. - Argentina
> Te: +54-2293-444430 Fax: +54-2293-444431
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org