cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: XSP and ServletContext object
Date Mon, 16 Sep 2002 12:36:01 GMT
Werner Guttmann wrote:

>Hi,
>
>the output of the XSP generator seems to indicate that in an XSP doc (or
>logicsheet), there are a set of "built-in" variables that
>you can use to access servlet objects (taken from the comments in the
>java file derived from an XSP doc):
>
>    /* Built-in parameters available for use */
>    // context    - ServletContext
>

Please read this line as
            // context - org.apache.cocoon.environment.Context


PS You forgot to include into email snippet from your XSP code.

Vadim



>    // request    - org.apache.cocoon.environment.Request
>    // response   - org.apache.cocoon.environment.Response
>    // parameters - parameters defined in the sitemap
>
>Now, when trying to use the context object, I am getting the following
>exception:
>
>org.apache.cocoon.ProcessingException: Language Exception:
>org.apache.cocoon.components.language.LanguageException: Error compiling
>
>instruction_controller_xml:
>Line 118, column 50:  Class javax.servlet.ServletContext not found in
>void generate().
>Line 0, column 0:
>1 error
>
> at
>org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:340)
>
> at
>org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:292)
>
> at
>org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java:198)
>
> at
>org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:202)
>
> at
>org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:278)
>
> at
>org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:141)
>
> at
>org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:317)
>
> at
>org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:153)
>
> at
>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)
>
> at
>org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:156)
>
> at
>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
>
> at
>org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:140)
>
> at
>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
>
> at
>org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:144)
>
> at
>org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:328)
>
> at
>org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:293)
>
> at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
> at
>org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
>with the root being
>
>org.apache.cocoon.components.language.LanguageException: Error compiling
>instruction_controller_xml:
>Line 118, column 50:  Class javax.servlet.ServletContext not found in
>void generate().
>Line 0, column 0:
>1 error
>
> at
>org.apache.cocoon.components.language.programming.java.JavaLanguage.compile(JavaLanguage.java:243)
>
> at
>org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:207)
>
> at
>org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:388)
>
> at
>org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:333)
>
> at
>org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:292)
>
> at
>org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java:198)
>
> at
>org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:202)
>
> at
>org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:278)
>
> at
>org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:141)
>
> at
>org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:317)
>
> at
>org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:153)
>
> at
>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)
>
> at
>org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:156)
>
> at
>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
>
> at
>prg.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:140)
>
> at
>org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
>
> at
>org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:144)
>
> at
>org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:328)
>
> at
>org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:293)
>
> at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
> at
>org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
>It looks like the ServletContexrt object is not available as this time.
>Can anybody please confirm, or provide a way of accessing the
>ServletContext object from within an XSP ?
>
>Thanks
>Werner
>  
>


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

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


Mime
View raw message