cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ultan o'carroll <ul...@totalise.co.uk>
Subject Re: Newbie - session/request object at class level ?
Date Thu, 03 Aug 2000 10:43:54 GMT

Thanks for your reply Robin,

Ive checked out what you said and looked at the produced code for my XSP page
and can see where the HttpSession and HttpServletRequest are being made
available.
Having made the changes I needed, Im now getting a NullPointerException in
populateDocument(...). Any ideas on how to debug this ? I suspect I need to
import the source into my IDE for debug. Ive tried setting the debug level flag
in cocoon.properties but its not giving me much help.

(Of course what I really want is XSP support in my IDE - VisualAge )

BTW, how come you're such an expert on Cocoon - are you involved in the
development ?
Thanks again for your help

Ultan O'Carroll

Robin Green wrote:

> ultan o'carroll <ultan@totalise.co.uk> wrote:
> >Im getting errors when I try to use a tag library that Im developing
> >(trying to develop I should say)
> >telling me that I have "undefined variable or class names" (sepcifically
> >request, session, log)
> >when I try to use these objects in the class level logic element of the
> >library (see <!-- ** here ** --> comments )-
> >
>
> They are passed as parameters to the implicit page generation method, and by
> default can only be accessed inside the <page> element, or whatever your
> root page element is called inside <xsp:page>. But you can easily pass them
> outside by passing them to methods as arguments or assigning them to
> instance variables. Instance variables in the XSP page are NOT recommended
> for this purpose, as they can easily cause all sorts of problems, including
> nasty hard-to-track threading problems.
>
> Final "variables" are safe though. For example, an exception to the above
> paragraph is servletContext, which is a final instance variable which is set
> automatically - you don't have to do anything to be able to use it anywhere
> on the XSP page.
>
> Example for session:
>
> <xsp:logic>
>   public void myMethod (HttpSession session) {
>     // ...
>   }
> </xsp:logic>
>
> <page>
>   myMethod (session);
> </page>
>
> --
> Robin Green
> i-tao Ltd.
> 4 Skyline Village
> Limeharbour
> London E14 9TS
> United Kingdom
> Phone +44 20 7537 2233  Fax +44 70 8081 5118
> http://www.i-tao.com
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> ---------------------------------------------------------------------
> 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