You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Anna Bikkina <an...@pinksheets.com> on 2004/02/02 22:50:14 UTC

Using existing jsp file

Hi,

I have an existing website which has jsp files and html files. I want to use 
the jsp's directly when porting to cocoon. Cocoon is complaining about jsp 
tags, META tags(html) and other "&" symbols in between the text. Can anyone 
help me how I can overcome this and use existing jsp's and htmls in cocoon 
directly so that I do not have to rewrite them. 

ps: I added the JSp generator and reader to the main component section of the 
sitemap.

Thanks,
Anna.


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


Re: Using existing jsp file

Posted by Joerg Heinicke <jo...@gmx.de>.
On 03.02.2004 16:33, Anna Bikkina wrote:

> Thanks for the explanation. I understand it better now, but I still have a 
> problem accessing my jsp page. I am using map:read in map:matches(*.jsp) 
> instead of generate
> 
> When I use read or generate I am getting the below error . The error is not 
> descriptive. I got the latest code from cocoon and am using it. Any help 
> would be appreciated.
> 
> org.apache.cocoon.ProcessingException: ServletException while executing 
> JSPEngine: org.apache.jasper.JasperException

No reason, no cause somewhere in the stacktrace? Do you use jsp includes 
or forwards, which do not work AFAIK?

The JSP stuff was integrated into Cocoon only as support for legacy code 
and possible step by step movement to Cocoon. Unfortunately this means 
that not many people use this code and it's not quite perfect. If 
nothing helps to get that working using Cocoon is it possible for you to 
circumvent Cocoon for the JSP requests and give them directly to the 
servlet container?

Joerg

> On Monday 02 February 2004 07:07 pm, Joerg Heinicke wrote:
> 
>>>This must be a basic question. I have a JSP generator and JSP reader in
>>>my sitemap. I understand that if I use the JSPReader it can read non xml
>>>jsp pages. How can I make cocoon use jspreader instead of the
>>>generator.Correct me if my understanding is wrong.
>>
>>Just have a look into the sitemap you are using (I guess it's the
>>default sitemap from JSP block).
>>
>>       <map:match pattern="*.htm">
>>         <map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
>>       </map:match>
>>
>>The above pipeline uses the JSPReader and gives the result as text/html
>>to the client.
>>
>>       <!-- Use this to debug your JSPs -->
>>       <map:match pattern="*.xml">
>>         <map:generate type="jsp" src="{1}.jsp"/>
>>         <map:serialize type="xml"/>
>>       </map:match>
>>
>>The above pipeline uses the JSPGenerator and serializes the SAX events
>>to XML.
>>
>>       <map:match pattern="*.jsp">
>>         <map:generate type="jsp" src="{1}.jsp"/>
>>         <map:serialize type="html"/>
>>       </map:match>
>>
>>The above pipeline uses the JSPGenerator and serializes the SAX events
>>to HTML.
>>
>>map:read => Reader, map:generate => Generator.
>>
>>Joerg

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


Re: Using existing jsp file

Posted by Anna Bikkina <an...@pinksheets.com>.
Thanks for the explanation. I understand it better now, but I still have a 
problem accessing my jsp page. I am using map:read in map:matches(*.jsp) 
instead of generate

When I use read or generate I am getting the below error . The error is not 
descriptive. I got the latest code from cocoon and am using it. Any help 
would be appreciated.

org.apache.cocoon.ProcessingException: ServletException while executing 
JSPEngine: org.apache.jasper.JasperException

Thanks,
Anna.

On Monday 02 February 2004 07:07 pm, Joerg Heinicke wrote:
> On 03.02.2004 00:52, Anna Bikkina wrote:
> > This must be a basic question. I have a JSP generator and JSP reader in
> > my sitemap. I understand that if I use the JSPReader it can read non xml
> > jsp pages. How can I make cocoon use jspreader instead of the
> > generator.Correct me if my understanding is wrong.
>
> Just have a look into the sitemap you are using (I guess it's the
> default sitemap from JSP block).
>
>        <map:match pattern="*.htm">
>          <map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
>        </map:match>
>
> The above pipeline uses the JSPReader and gives the result as text/html
> to the client.
>
>        <!-- Use this to debug your JSPs -->
>        <map:match pattern="*.xml">
>          <map:generate type="jsp" src="{1}.jsp"/>
>          <map:serialize type="xml"/>
>        </map:match>
>
> The above pipeline uses the JSPGenerator and serializes the SAX events
> to XML.
>
>        <map:match pattern="*.jsp">
>          <map:generate type="jsp" src="{1}.jsp"/>
>          <map:serialize type="html"/>
>        </map:match>
>
> The above pipeline uses the JSPGenerator and serializes the SAX events
> to HTML.
>
> map:read => Reader, map:generate => Generator.
>
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: Using existing jsp file

Posted by Upayavira <uv...@upaya.co.uk>.
Anna Bikkina wrote:

>This must be a basic question. I have a JSP generator and JSP reader in my 
>sitemap. I understand that if I use the JSPReader it can read non xml jsp 
>pages. How can I make cocoon use jspreader instead of the generator.Correct 
>me if my understanding is wrong.
>  
>
<map:match pattern="page">
  <map:read type="jsp" src="page.jsp"/>
</map:match>

Upayavira

>I will get the latest cocoon and run it .
>
>Thank you once again for the responses.
>Anna.
>
>
>On Monday 02 February 2004 06:49 pm, Joerg Heinicke wrote:
>  
>
>>On 03.02.2004 00:38, Anna Bikkina wrote:
>>    
>>
>>>>>I need the output in the cocoon pipelines. I am already using the
>>>>>jspReader but it gives me errors.  Below is the sitemap that I am using
>>>>>to generate jsp pages. Is JSPReader another option of
>>>>>JTidy/JSPGenerator.
>>>>>          
>>>>>
>>>>You still have the explanation of the two components in your sitemap:
>>>>
>>>>JSPGenerator: JspGenerator is used to get result of a JSP page then
>>>>output it as XML (SAX events)
>>>>
>>>>JSPReader: JSPReader is used to serve direct output from a JSP page.
>>>>Note, that JSP result can be non XML
>>>>
>>>>This means the reader has no problem with reading non-XML as it does not
>>>>have to create SAX events out of it. It just outputs the result to the
>>>>client.
>>>>
>>>>The JSPGenerator *does* generate SAX events of it, i.e. it parses the
>>>>JSP output. But this will only work with well-formed XML output.
>>>>        
>>>>
>>>Since I have both the JSPGenerator and the JSPReader in the sitemap.
>>>Which one is used to display the output of the jsp page.
>>>      
>>>
>>Sorry, but I don't understand what these 2 sentences should mean.
>>
>>    
>>
>>>>When I asked for the need of the JSP output in the pipelines I meant the
>>>>SAX events. If it is enough for you to give the JSP output directly to
>>>>the client, you do not need to parse it. Only if you need the SAX
>>>>events, e.g. for manipulating them via a transformer, you need the
>>>>tidying JSPGenerator.
>>>>
>>>>You said you got errors with JSPReader? What's the error? It should work
>>>>the same way like JSPGenerator (besides the parsing of course).
>>>>        
>>>>
>>>Here is the error I got
>>>
>>>An Error Occurred
>>>
>>>
>>>ServletException in JspGenerator.generate()
>>>
>>>
>>>org.apache.cocoon.ProcessingException: ServletException in
>>>JspGenerator.generate()
>>>
>>>
>>>cause: org.apache.cocoon.ProcessingException: ServletException in
>>>JspGenerator.generate()
>>>
>>>
>>>stacktrace[hide]
>>>
>>>org.apache.cocoon.ProcessingException: ServletException in
>>>JspGenerator.generate()
>>>        at
>>>org.apache.cocoon.generation.JspGenerator.generate(JspGenerator.java:124)
>>>      
>>>
>>Unfortunately that's the shortened stacktrace that is not very helpful.
>>This issue was fixed only some days ago:
>>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23269.
>>
>>Is it possible for you to either update your Cocoon to latest CVS
>>version or to modify your local code as in the diff at
>>http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/jsp/java/org/apache
>>/cocoon/reading/JSPReader.java?r1=1.8&r2=1.9&diff_format=h It's just the
>>getRootCause() that must be removed in JSPReader. You must rebuild Cocoon
>>afterwards, but alltogether it should not take more than 5 minutes. You can
>>make the same change in the JSPGenerator class as this one could fail with
>>the same not helpful message:
>>http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/jsp/java/org/apache
>>/cocoon/generation/JSPGenerator.java?r1=1.1&r2=1.2&diff_format=h
>>
>>Joerg
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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


Re: Using existing jsp file

Posted by Joerg Heinicke <jo...@gmx.de>.
On 03.02.2004 00:52, Anna Bikkina wrote:

> This must be a basic question. I have a JSP generator and JSP reader in my 
> sitemap. I understand that if I use the JSPReader it can read non xml jsp 
> pages. How can I make cocoon use jspreader instead of the generator.Correct 
> me if my understanding is wrong.

Just have a look into the sitemap you are using (I guess it's the 
default sitemap from JSP block).

       <map:match pattern="*.htm">
         <map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
       </map:match>

The above pipeline uses the JSPReader and gives the result as text/html 
to the client.

       <!-- Use this to debug your JSPs -->
       <map:match pattern="*.xml">
         <map:generate type="jsp" src="{1}.jsp"/>
         <map:serialize type="xml"/>
       </map:match>

The above pipeline uses the JSPGenerator and serializes the SAX events 
to XML.

       <map:match pattern="*.jsp">
         <map:generate type="jsp" src="{1}.jsp"/>
         <map:serialize type="html"/>
       </map:match>

The above pipeline uses the JSPGenerator and serializes the SAX events 
to HTML.

map:read => Reader, map:generate => Generator.

Joerg

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


Re: Using existing jsp file

Posted by Anna Bikkina <an...@pinksheets.com>.
This must be a basic question. I have a JSP generator and JSP reader in my 
sitemap. I understand that if I use the JSPReader it can read non xml jsp 
pages. How can I make cocoon use jspreader instead of the generator.Correct 
me if my understanding is wrong.

I will get the latest cocoon and run it .

Thank you once again for the responses.
Anna.


On Monday 02 February 2004 06:49 pm, Joerg Heinicke wrote:
> On 03.02.2004 00:38, Anna Bikkina wrote:
> >>>I need the output in the cocoon pipelines. I am already using the
> >>>jspReader but it gives me errors.  Below is the sitemap that I am using
> >>>to generate jsp pages. Is JSPReader another option of
> >>> JTidy/JSPGenerator.
> >>
> >>You still have the explanation of the two components in your sitemap:
> >>
> >>JSPGenerator: JspGenerator is used to get result of a JSP page then
> >>output it as XML (SAX events)
> >>
> >>JSPReader: JSPReader is used to serve direct output from a JSP page.
> >>Note, that JSP result can be non XML
> >>
> >>This means the reader has no problem with reading non-XML as it does not
> >>have to create SAX events out of it. It just outputs the result to the
> >>client.
> >>
> >>The JSPGenerator *does* generate SAX events of it, i.e. it parses the
> >>JSP output. But this will only work with well-formed XML output.
> >
> > Since I have both the JSPGenerator and the JSPReader in the sitemap.
> > Which one is used to display the output of the jsp page.
>
> Sorry, but I don't understand what these 2 sentences should mean.
>
> >>When I asked for the need of the JSP output in the pipelines I meant the
> >>SAX events. If it is enough for you to give the JSP output directly to
> >>the client, you do not need to parse it. Only if you need the SAX
> >>events, e.g. for manipulating them via a transformer, you need the
> >>tidying JSPGenerator.
> >>
> >>You said you got errors with JSPReader? What's the error? It should work
> >>the same way like JSPGenerator (besides the parsing of course).
> >
> > Here is the error I got
> >
> > An Error Occurred
> >
> >
> > ServletException in JspGenerator.generate()
> >
> >
> > org.apache.cocoon.ProcessingException: ServletException in
> > JspGenerator.generate()
> >
> >
> > cause: org.apache.cocoon.ProcessingException: ServletException in
> > JspGenerator.generate()
> >
> >
> > stacktrace[hide]
> >
> > org.apache.cocoon.ProcessingException: ServletException in
> > JspGenerator.generate()
> >         at
> > org.apache.cocoon.generation.JspGenerator.generate(JspGenerator.java:124)
>
> Unfortunately that's the shortened stacktrace that is not very helpful.
> This issue was fixed only some days ago:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23269.
>
> Is it possible for you to either update your Cocoon to latest CVS
> version or to modify your local code as in the diff at
> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/jsp/java/org/apache
>/cocoon/reading/JSPReader.java?r1=1.8&r2=1.9&diff_format=h It's just the
> getRootCause() that must be removed in JSPReader. You must rebuild Cocoon
> afterwards, but alltogether it should not take more than 5 minutes. You can
> make the same change in the JSPGenerator class as this one could fail with
> the same not helpful message:
> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/jsp/java/org/apache
>/cocoon/generation/JSPGenerator.java?r1=1.1&r2=1.2&diff_format=h
>
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: Using existing jsp file

Posted by Joerg Heinicke <jo...@gmx.de>.
On 03.02.2004 00:38, Anna Bikkina wrote:

>>>I need the output in the cocoon pipelines. I am already using the
>>>jspReader but it gives me errors.  Below is the sitemap that I am using
>>>to generate jsp pages. Is JSPReader another option of JTidy/JSPGenerator.
>>
>>You still have the explanation of the two components in your sitemap:
>>
>>JSPGenerator: JspGenerator is used to get result of a JSP page then
>>output it as XML (SAX events)
>>
>>JSPReader: JSPReader is used to serve direct output from a JSP page.
>>Note, that JSP result can be non XML
>>
>>This means the reader has no problem with reading non-XML as it does not
>>have to create SAX events out of it. It just outputs the result to the
>>client.
>>
>>The JSPGenerator *does* generate SAX events of it, i.e. it parses the
>>JSP output. But this will only work with well-formed XML output.
> 
> 
> 
> Since I have both the JSPGenerator and the JSPReader in the sitemap. Which one 
> is used to display the output of the jsp page. 

Sorry, but I don't understand what these 2 sentences should mean.

>>When I asked for the need of the JSP output in the pipelines I meant the
>>SAX events. If it is enough for you to give the JSP output directly to
>>the client, you do not need to parse it. Only if you need the SAX
>>events, e.g. for manipulating them via a transformer, you need the
>>tidying JSPGenerator.
>>
>>You said you got errors with JSPReader? What's the error? It should work
>>the same way like JSPGenerator (besides the parsing of course).
>>
> 
> 
> Here is the error I got 
> 
> An Error Occurred
> 
> 
> ServletException in JspGenerator.generate()
> 
> 
> org.apache.cocoon.ProcessingException: ServletException in 
> JspGenerator.generate()
> 
> 
> cause: org.apache.cocoon.ProcessingException: ServletException in 
> JspGenerator.generate()
> 
> 
> stacktrace[hide] 
> 
> org.apache.cocoon.ProcessingException: ServletException in 
> JspGenerator.generate()
>         at 
> org.apache.cocoon.generation.JspGenerator.generate(JspGenerator.java:124)

Unfortunately that's the shortened stacktrace that is not very helpful. 
This issue was fixed only some days ago: 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23269.

Is it possible for you to either update your Cocoon to latest CVS 
version or to modify your local code as in the diff at 
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/reading/JSPReader.java?r1=1.8&r2=1.9&diff_format=h
It's just the getRootCause() that must be removed in JSPReader. You must 
rebuild Cocoon afterwards, but alltogether it should not take more than 
5 minutes. You can make the same change in the JSPGenerator class as 
this one could fail with the same not helpful message:
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/jsp/java/org/apache/cocoon/generation/JSPGenerator.java?r1=1.1&r2=1.2&diff_format=h

Joerg

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


Re: Using existing jsp file

Posted by Anna Bikkina <an...@pinksheets.com>.
On Monday 02 February 2004 06:19 pm, Joerg Heinicke wrote:
> On 03.02.2004 00:00, Anna Bikkina wrote:
> > I need the output in the cocoon pipelines. I am already using the
> > jspReader but it gives me errors.  Below is the sitemap that I am using
> > to generate jsp pages. Is JSPReader another option of JTidy/JSPGenerator.
>
> You still have the explanation of the two components in your sitemap:
>
> JSPGenerator: JspGenerator is used to get result of a JSP page then
> output it as XML (SAX events)
>
> JSPReader: JSPReader is used to serve direct output from a JSP page.
> Note, that JSP result can be non XML
>
> This means the reader has no problem with reading non-XML as it does not
> have to create SAX events out of it. It just outputs the result to the
> client.
>
> The JSPGenerator *does* generate SAX events of it, i.e. it parses the
> JSP output. But this will only work with well-formed XML output.


Since I have both the JSPGenerator and the JSPReader in the sitemap. Which one 
is used to display the output of the jsp page. 

>
> When I asked for the need of the JSP output in the pipelines I meant the
> SAX events. If it is enough for you to give the JSP output directly to
> the client, you do not need to parse it. Only if you need the SAX
> events, e.g. for manipulating them via a transformer, you need the
> tidying JSPGenerator.
>
> You said you got errors with JSPReader? What's the error? It should work
> the same way like JSPGenerator (besides the parsing of course).
>

Here is the error I got 

An Error Occurred


ServletException in JspGenerator.generate()


org.apache.cocoon.ProcessingException: ServletException in 
JspGenerator.generate()


cause: org.apache.cocoon.ProcessingException: ServletException in 
JspGenerator.generate()


stacktrace[hide] 

org.apache.cocoon.ProcessingException: ServletException in 
JspGenerator.generate()
        at 
org.apache.cocoon.generation.JspGenerator.generate(JspGenerator.java:124)
        at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:557)
        at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:196)
        at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:501)
        at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:147)
        at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
        at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
        at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
        at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163)
        at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
        at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152)
        at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354)
        at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307)
        at 
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133)
        at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractPar


> Joerg
>
> > <?xml version="1.0"?>
> > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> >
> >   <!-- =========================== Components
> > ================================ -->
> >   <map:components>
> >     <map:generators default="file">
> >       <!-- JspGenerator is used to get result of a JSP page
> >            then output it as XML (SAX events)
> >       -->
> >       <map:generator logger="sitemap.generator.jsp" name="jsp"
> >                      src="org.apache.cocoon.generation.JspGenerator"/>
> >     </map:generators>
> >     <map:transformers default="xslt"/>
> >     <map:readers default="resource">
> >       <!-- JSPReader is used to serve direct output from
> >            a JSP page. Note, that JSP result can be non XML  -->
> >       <map:reader logger="sitemap.reader.jsp" name="jsp"
> >                   src="org.apache.cocoon.reading.JSPReader"/>
> >     </map:readers>
> >     <map:serializers default="html"/>
> >     <map:matchers default="wildcard"/>
> >     <map:selectors default="browser"/>
> >   </map:components>
> >
> >   <!-- =========================== Pipelines
> > ================================= -->
> >   <map:pipelines>
> >     <map:pipeline>
> >       <!-- This works only if TreeProcessor is used -->
> >       <map:match pattern="">
> >         <map:redirect-to uri="welcome.htm" />
> >       </map:match>
> >
> >       <map:match pattern="*.htm">
> >         <map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
> >       </map:match>
> >
> >       <!-- Use this to debug your JSPs -->
> >       <map:match pattern="*.xml">
> >         <map:generate type="jsp" src="{1}.jsp"/>
> >         <map:serialize type="xml"/>
> >       </map:match>
> >
> >       <map:match pattern="*.jsp">
> >         <map:generate type="jsp" src="{1}.jsp"/>
> >         <map:serialize type="html"/>
> >       </map:match>
> >
> >           <!--+
> >
> >     | Mount everything else by calling the sitemap.xmap file located
> >     | in the requested folder.
> >
> >     +-->
> >     <map:match pattern="*/**">
> >       <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
> >     </map:match>
> >
> >     </map:pipeline>
> >   </map:pipelines>
> > </map:sitemap>
> > <!-- end of file -->
> >
> > On Monday 02 February 2004 05:46 pm, Joerg Heinicke wrote:
> >>On 02.02.2004 23:24, Anna Bikkina wrote:
> >>>Looks like my jsp pages are not well formatted xml docs. They are more
> >>>html stuff with jsp tags. Can anyone help me use the same jsps without
> >>>rewriting the existing ones. Rewriting them would be a lot of work and
> >>> we do not have so much time to complete the project.
> >>
> >>Do you need the output of the JSP in the Cocoon pipelines? If not you
> >>can use JSPReader. Otherwise you need to extend the JSPGenerator with
> >>the JTidy functionality as in HTMLGenerator.
> >>
> >>Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: Using existing jsp file

Posted by Joerg Heinicke <jo...@gmx.de>.
On 03.02.2004 00:00, Anna Bikkina wrote:

> I need the output in the cocoon pipelines. I am already using the jspReader 
> but it gives me errors.  Below is the sitemap that I am using to generate jsp 
> pages. Is JSPReader another option of JTidy/JSPGenerator. 

You still have the explanation of the two components in your sitemap:

JSPGenerator: JspGenerator is used to get result of a JSP page then 
output it as XML (SAX events)

JSPReader: JSPReader is used to serve direct output from a JSP page. 
Note, that JSP result can be non XML

This means the reader has no problem with reading non-XML as it does not 
have to create SAX events out of it. It just outputs the result to the 
client.

The JSPGenerator *does* generate SAX events of it, i.e. it parses the 
JSP output. But this will only work with well-formed XML output.

When I asked for the need of the JSP output in the pipelines I meant the 
SAX events. If it is enough for you to give the JSP output directly to 
the client, you do not need to parse it. Only if you need the SAX 
events, e.g. for manipulating them via a transformer, you need the 
tidying JSPGenerator.

You said you got errors with JSPReader? What's the error? It should work 
the same way like JSPGenerator (besides the parsing of course).

Joerg

> <?xml version="1.0"?>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
> 
>   <!-- =========================== Components ================================ 
> -->
>   <map:components>
>     <map:generators default="file">
>       <!-- JspGenerator is used to get result of a JSP page 
>            then output it as XML (SAX events)
>       -->
>       <map:generator logger="sitemap.generator.jsp" name="jsp"
>                      src="org.apache.cocoon.generation.JspGenerator"/>
>     </map:generators>
>     <map:transformers default="xslt"/>
>     <map:readers default="resource">
>       <!-- JSPReader is used to serve direct output from 
>            a JSP page. Note, that JSP result can be non XML  -->
>       <map:reader logger="sitemap.reader.jsp" name="jsp" 
>                   src="org.apache.cocoon.reading.JSPReader"/>
>     </map:readers>
>     <map:serializers default="html"/>
>     <map:matchers default="wildcard"/>
>     <map:selectors default="browser"/>
>   </map:components>
> 
>   <!-- =========================== Pipelines ================================= 
> -->
>   <map:pipelines>
>     <map:pipeline>
>       <!-- This works only if TreeProcessor is used -->
>       <map:match pattern="">
>         <map:redirect-to uri="welcome.htm" />
>       </map:match>
> 
>       <map:match pattern="*.htm">
>         <map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
>       </map:match>
> 
>       <!-- Use this to debug your JSPs -->
>       <map:match pattern="*.xml">
>         <map:generate type="jsp" src="{1}.jsp"/>
>         <map:serialize type="xml"/>
>       </map:match>
> 
>       <map:match pattern="*.jsp">
>         <map:generate type="jsp" src="{1}.jsp"/>
>         <map:serialize type="html"/>
>       </map:match>
>       
>           <!--+
>     | Mount everything else by calling the sitemap.xmap file located
>     | in the requested folder.
>     +-->
>     <map:match pattern="*/**">
>       <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
>     </map:match>
> 
>     </map:pipeline>
>   </map:pipelines>
> </map:sitemap>
> <!-- end of file -->
> 
> 
> On Monday 02 February 2004 05:46 pm, Joerg Heinicke wrote:
> 
>>On 02.02.2004 23:24, Anna Bikkina wrote:
>>
>>>Looks like my jsp pages are not well formatted xml docs. They are more
>>>html stuff with jsp tags. Can anyone help me use the same jsps without
>>>rewriting the existing ones. Rewriting them would be a lot of work and we
>>>do not have so much time to complete the project.
>>
>>Do you need the output of the JSP in the Cocoon pipelines? If not you
>>can use JSPReader. Otherwise you need to extend the JSPGenerator with
>>the JTidy functionality as in HTMLGenerator.
>>
>>Joerg

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


Re: Using existing jsp file

Posted by Anna Bikkina <an...@pinksheets.com>.
I need the output in the cocoon pipelines. I am already using the jspReader 
but it gives me errors.  Below is the sitemap that I am using to generate jsp 
pages. Is JSPReader another option of JTidy/JSPGenerator. 

Thanks,
Anna


<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

  <!-- =========================== Components ================================ 
-->
  <map:components>
    <map:generators default="file">
      <!-- JspGenerator is used to get result of a JSP page 
           then output it as XML (SAX events)
      -->
      <map:generator logger="sitemap.generator.jsp" name="jsp"
                     src="org.apache.cocoon.generation.JspGenerator"/>
    </map:generators>
    <map:transformers default="xslt"/>
    <map:readers default="resource">
      <!-- JSPReader is used to serve direct output from 
           a JSP page. Note, that JSP result can be non XML  -->
      <map:reader logger="sitemap.reader.jsp" name="jsp" 
                  src="org.apache.cocoon.reading.JSPReader"/>
    </map:readers>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:selectors default="browser"/>
  </map:components>

  <!-- =========================== Pipelines ================================= 
-->
  <map:pipelines>
    <map:pipeline>
      <!-- This works only if TreeProcessor is used -->
      <map:match pattern="">
        <map:redirect-to uri="welcome.htm" />
      </map:match>

      <map:match pattern="*.htm">
        <map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
      </map:match>

      <!-- Use this to debug your JSPs -->
      <map:match pattern="*.xml">
        <map:generate type="jsp" src="{1}.jsp"/>
        <map:serialize type="xml"/>
      </map:match>

      <map:match pattern="*.jsp">
        <map:generate type="jsp" src="{1}.jsp"/>
        <map:serialize type="html"/>
      </map:match>
      
          <!--+
    | Mount everything else by calling the sitemap.xmap file located
    | in the requested folder.
    +-->
    <map:match pattern="*/**">
      <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
    </map:match>

    </map:pipeline>
  </map:pipelines>
</map:sitemap>
<!-- end of file -->


On Monday 02 February 2004 05:46 pm, Joerg Heinicke wrote:
> On 02.02.2004 23:24, Anna Bikkina wrote:
> > Looks like my jsp pages are not well formatted xml docs. They are more
> > html stuff with jsp tags. Can anyone help me use the same jsps without
> > rewriting the existing ones. Rewriting them would be a lot of work and we
> > do not have so much time to complete the project.
>
> Do you need the output of the JSP in the Cocoon pipelines? If not you
> can use JSPReader. Otherwise you need to extend the JSPGenerator with
> the JTidy functionality as in HTMLGenerator.
>
> Joerg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: Using existing jsp file

Posted by Joerg Heinicke <jo...@gmx.de>.
On 02.02.2004 23:24, Anna Bikkina wrote:
> Looks like my jsp pages are not well formatted xml docs. They are more html 
> stuff with jsp tags. Can anyone help me use the same jsps without rewriting 
> the existing ones. Rewriting them would be a lot of work and we do not have 
> so much time to complete the project.

Do you need the output of the JSP in the Cocoon pipelines? If not you 
can use JSPReader. Otherwise you need to extend the JSPGenerator with 
the JTidy functionality as in HTMLGenerator.

Joerg

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


Re: Using existing jsp file

Posted by Anna Bikkina <an...@pinksheets.com>.
Looks like my jsp pages are not well formatted xml docs. They are more html 
stuff with jsp tags. Can anyone help me use the same jsps without rewriting 
the existing ones. Rewriting them would be a lot of work and we do not have 
so much time to complete the project.

Thanks,
Anna.


On Monday 02 February 2004 05:09 pm, Upayavira wrote:
> Anna Bikkina wrote:
> >Hi,
> >
> >I have an existing website which has jsp files and html files. I want to
> > use the jsp's directly when porting to cocoon. Cocoon is complaining
> > about jsp tags, META tags(html) and other "&" symbols in between the
> > text. Can anyone help me how I can overcome this and use existing jsp's
> > and htmls in cocoon directly so that I do not have to rewrite them.
> >
> >ps: I added the JSp generator and reader to the main component section of
> > the sitemap.
>
> does your JSP output well formed XML? The JSPGenerator will expect that
> of a JSP page. If not, others here might be able to help you work with
> your current pages.
>
> Regards, Upayavira
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Re: Using existing jsp file

Posted by Upayavira <uv...@upaya.co.uk>.
Anna Bikkina wrote:

>Hi,
>
>I have an existing website which has jsp files and html files. I want to use 
>the jsp's directly when porting to cocoon. Cocoon is complaining about jsp 
>tags, META tags(html) and other "&" symbols in between the text. Can anyone 
>help me how I can overcome this and use existing jsp's and htmls in cocoon 
>directly so that I do not have to rewrite them. 
>
>ps: I added the JSp generator and reader to the main component section of the 
>sitemap.
>  
>
does your JSP output well formed XML? The JSPGenerator will expect that 
of a JSP page. If not, others here might be able to help you work with 
your current pages.

Regards, Upayavira



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