First of all, Thank you very much. I got some insight into my problems thanks to yout hints.
I could not manage to use the built-in parameters.
------------------------------------------------------------------------------------------
I tried something very simple, just to start (i tried many more similar with context ecc, I also tried to include esplicitally org.apache.cocoon.environment.* package...)
<xsp:logic> String prova = request.getProtocol(); </xsp:logic>
------------------------------------------------------------------------------------------ the generarated XSP.java fragment is:
/* Built-in parameters available for use */ // context - org.apache.cocoon.environment.Context // request - org.apache.cocoon.environment.Request // response - org.apache.cocoon.environment.Response // parameters - parameters defined in the sitemap // objectModel- java.util.Map // resolver - org.apache.cocoon.environment.SourceResolver
/* User Class Declarations */
String prova = request.getProtocol();
-----------------------------------------------------------------------------------------------
but i got this error at runtime (before compilation I suppose, as cimpiled XSP doesn't appear.)
Internal Server Error
Message: Language Exception
Description: org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error while instantiating org/apache/cocoon/www/laos/xsp/index_xsp: java.lang.NullPointerException
Sender: org.apache.cocoon.servlet.CocoonServlet
Source: Cocoon Servlet
Request URI
it/index.xhtml
cause
java.lang.NullPointerException
request-uri
/it/index.xhtml
full exception chain stacktrace
Original Exception: org.apache.cocoon.components.language.LanguageException: Error while instantiating org/apache/cocoon/www/laos/xsp/index_xsp: java.lang.NullPointerException at org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:228) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loadProgram(ProgramGeneratorImpl.java:434) at org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:315) at org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGenerator.java:204)
..................... stack trace follow ...........................
Christopher Painter-Wakefield wrote:
1. The request, context, and I believe the response object are declared and initialized for you, and can be used from any xsp:logic block. The request object is "request", etc. The session object is available from the request (request.getSession()), or is declared as "session" if you use the xsp-session logicsheet. These objects are Cocoon implementations, not the HttpServletRequest, etc. objects (look for Request, Session, etc. in the Cocoon API docs: http://cocoon.apache.org/2.1/apidocs/index.html
You can learn a lot about the environment of an XSP program by looking at the class all XSP programs inherit from: XSPGenerator (again, see the API docs). You can also learn a lot by looking at the java source generated from your XSP pages (location varies depending on your servlet engine).
I'm not sure where there might be good documentation on these kinds of basics, but perhaps one of the books available on Cocoon would help - just search Amazon for "Cocoon".
-- people fall into 10 categories, who knows the binary and who doesn't
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]