You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Eric Fesler <er...@hubmethods.com> on 2001/10/19 10:55:52 UTC

C2 - JSPGenerator and jsp:include

Hi,


I'm having some trouble working with the JSPGenerator.

I'm using a JSP to generate the XML representation of an session resident
object. However, because this object presents some recursive
characteristics, I use the tag <jsp:include>.

The JSP itself works properly. However, when I'm using this JSP as a
generator for Cocoon, I've got the following error:


I've looked at the source (both Tomcat and Cocoon) and it is obvious that it
could not work.
Indeed:
In org.apache.cocoon.components.jsp.JSPEngineImpl, Cocoon wraps the request
in a MyServletRequest implementing HttpServletRequest.
However, when working with include, Tomcat expects a request of the class
org.apache.tomcat.facade.HttpServletRequestFacade

So it generates a ClassCastException.

Any idea how to solve that or how to work around that?

Maybe there is another solution than using the JSPGenerator but the object I
want to render is create by a web application. So I've embedded Cocoon in
that application and I pass the object I want to render to Cocoon within the
session.

I don't want to create an xml file and then call Cocoon because the
application is aimed to be used by a lot of concurrent user and I prefer to
work with objects in memory rather than written in a file.

Thanks for help,


Eric


P.S.: I'm using Tomcat 3.2.3 and Cocoon 2


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: C2 - JSPGenerator and jsp:include

Posted by Eric Fesler <er...@hubmethods.com>.
Oops, I remark I forgot the error in the message.

Here it is.

org.apache.cocoon.ProcessingException: ServletException in
JspGenerator.generate(): java.lang.ClassCastException:
org.apache.cocoon.components.jsp.JSPEngineImpl$MyServletRequest

	at org.apache.cocoon.generation.JspGenerator.generate(JspGenerator.java:84)

	at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv
entPipeline.java:210)

	at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
treamPipeline.java:350)

	at
org.apache.cocoon.www.sitemap_xmap.wildcardMatchN4005B9(sitemap_xmap.java:75
33)

	at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2707)
...

with an embedded error:
java.lang.ClassCastException:
org.apache.cocoon.components.jsp.JSPEngineImpl$MyServletRequest

	at
org.apache.tomcat.facade.RequestDispatcherImpl.doInclude(RequestDispatcherIm
pl.java:277)

	at
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl
.java:270)

	at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)

	at
xml.bsquare._0002fxml_0002fbsquare_0002frfq_0005ffo_0002ejsprfq_0005ffo_jsp_
0._jspService(_0002fxml_0002fbsquare_0002frfq_0005ffo_0002ejsprfq_0005ffo_js
p_0.java:981)

	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)


Eric

> -----Message d'origine-----
> De : Eric Fesler [mailto:eric.fesler@hubmethods.com]
> Envoye : vendredi 19 octobre 2001 10:56
> A : cocoon-users@xml.apache.org
> Cc : Vincent Harcq
> Objet : C2 - JSPGenerator and jsp:include
>
>
>
> Hi,
>
>
> I'm having some trouble working with the JSPGenerator.
>
> I'm using a JSP to generate the XML representation of an session resident
> object. However, because this object presents some recursive
> characteristics, I use the tag <jsp:include>.
>
> The JSP itself works properly. However, when I'm using this JSP as a
> generator for Cocoon, I've got the following error:
>
>
> I've looked at the source (both Tomcat and Cocoon) and it is
> obvious that it
> could not work.
> Indeed:
> In org.apache.cocoon.components.jsp.JSPEngineImpl, Cocoon wraps
> the request
> in a MyServletRequest implementing HttpServletRequest.
> However, when working with include, Tomcat expects a request of the class
> org.apache.tomcat.facade.HttpServletRequestFacade
>
> So it generates a ClassCastException.
>
> Any idea how to solve that or how to work around that?
>
> Maybe there is another solution than using the JSPGenerator but
> the object I
> want to render is create by a web application. So I've embedded Cocoon in
> that application and I pass the object I want to render to Cocoon
> within the
> session.
>
> I don't want to create an xml file and then call Cocoon because the
> application is aimed to be used by a lot of concurrent user and I
> prefer to
> work with objects in memory rather than written in a file.
>
> Thanks for help,
>
>
> Eric
>
>
> P.S.: I'm using Tomcat 3.2.3 and Cocoon 2
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>