On 3/18/09, Noragen <nora...@gmx.net> wrote:
>
> Hi,
>
> i have two following problems:
>
> *1. problem:*
> I make an import from a python module in a PSPPage.
> In this python i want to have following globals like req and res (request
> and response and perhaps other global stuff i dont remember yet)
>
> from a psp-page i can surely call the script with script(self) to get the
> objects within the script like
> def script(self)
>     self.response().write("anytext")
>     self.request().session.set("sessionparam","blub")
>
> but anyhow it is something like stupid to do it in every function less then
> have this in a global context.
>

Tobias,
If I understand your question correctly you actually don't want a global
contact because then that context would be shared with all other threads
running in the appserver and you'd have requests overwritting that context.
You really want a per thread context (which is per active request).
Since an instance of the Servlet is created for each thread, you can assign
data to the Servlet or your page instance and access it in the methods of
that PSPPage subclass. So within the page "self" is your global context (but
be certain to clear it at the beginning or end of each page to
transaction to avoid accessing stale data in that thread).

Best Regards,
Steve
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to