On Fri, Nov 4, 2011 at 8:31 AM, Ruchira Wageesha <[email protected]> wrote:

>
>> On the JSS model below, what happens to any code that's in the file
>> outside of any function definitions?
>>
>
> Any code or function which are outside of doGet, doPost...etc methods will
> be executed on global scope and can be accessed within doGet(), doPost()...
> methods.
>
> i.e. The *.jss file is first loaded into Rhino engine, which adds all
> toplevel variables/functions into the top level scope. Then, relevant
> doXXX() function will be executed where we can access those toplevel
> variables/functions.
>

OK so any code outside these functions will get run at the point the code
is loaded. Do we give any guarantees about that - for example, how often do
we load that code? Under what conditions do we unload etc.?

Maybe for starters we should say that there must not be any code outside of
these functions and if you put anything there and it does something that
your problem/luck and that we do not guarantee how that will hold up in the
future.

Further, request, response, and session objects are passed as args to the
> doXXX() function, so won't be available to the outside of the function.
>

Yes.

Sanjiva.
-- 
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.;  http://wso2.com/
email: [email protected]; phone: +94 11 763 9614; cell: +94 77 787 6880 | +1
650 265 8311
blog: http://sanjiva.weerawarana.org/

Lean . Enterprise . Middleware
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to