[Laszlo-dev] presetting __lzobj for JavaRpc
Alexander Wallace
aw at rwmotloc.com
Wed Apr 9 07:39:02 PDT 2008
Hi All... I've made progress in my attempt to use Laszlo in portlets.
My plan has been to preset in _lzobj some initialized objects, for the
Open Laszlo app to read. They need to be initialized with stuff not
available to laszlo, so I'm instantiating them in the jsp that will
contain the OL app and creating the __lzobj map in advance and setting
it in the correct scope attribute, which in turn contains the objects
i want laszlo to be able to use via JavaRpc.
Here are my findings.
1 - using session scope for JavaRpc:
a) If i create the __lzobj map in advance from the jsp (new
org.openlaszlo.data.SessionBindingMap()), OL app WILL NOT read the
map. I ignore where it'll put the objects i ask it to create, but it
doesn't put it them in the __lzobj map i placed in the session.
b) If i let OL app create the map and place objects in it, i can see
the map from the jsp and add stuff to it. This is not good enough to
me unless i figure out a way to detect when OL app places stuff in the
map so that i can place other stuff after for it to read.
2 - using webapp scope for JavaRpc.
a) if i create __lzobj map in advance from the jsp (new HashMap), OL
app will read the map and use it for new objects it creates. I've yet
to test if it'll use objects i place in the map in advance, but i
guess it should.
b) I can also see in the jsp other objects added to the map by OL app,
which is good.
As you can see, option 2 works for what I'm trying to do, except that
I rather use session scoped variables since the objects i'm trying to
initialize are different per user.
Can anyone shed some light as to why my attempts in point #1 don't
work as expected? By looking at the JavaDataSource.java file, I can't
see any reason why it would not work, except maybe the internal
functionality of the SessionBindingMap, which i'll review first chance
i get.
Thanks to all!
More information about the Laszlo-dev
mailing list