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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]