Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Java external Scope=session, global, local, etc.
Binettoid
Can anyone explain what the difference is, when using Java externals in LS components? (7.1)
This doesn't seem to be documented anywhere.
Specifically, how (if at all) will this affect my custom usermanager class?
Find more posts tagged with
Comments
AlexC
This is where the actual external object is stored (the class that contains the method).
local - object created every single time for every user
session - object stored in the user session so each user gets only 1
global - there is only 1 object for everybody
This obviously only affects class members of the class that contains the external/prefix/controller and useful in keeping state.
MonkeyKing
AlexC,
if I put Scope="session" into a Controller, it doesn't work. It seems only work in an External, is there any way to make it work for a controller? I attached my code of a controller using a session scope and it can't load the same class from that session, it creates a new object each time I think.
Secondly, if a External is stored in the Session, how can I retrieve it out? If I can't retrieve it out, how can I manage the status of that external?
AlexC
The class that contains the external is stored in the session if you have member variables they will be session scoped.
Can you explain what you mean by "doesn't work", what is it not doing? Do you have a class variable that is not preserving session?
MonkeyKing
Hi AlexC,
Thx for replying, sorry abt I didn't make my question clearly. 'doesn't work' means doesn't work properly.
Here is my code, 'value' always be 100, it doesn't matter how many times I used this controller. If this controller's object is the session, 'value' should be increased each time when I retrieve this controller, but it always equals to 100.
AlexC
I will verify this case and let you know.
MonkeyKing
Thanks AlexC
AlexC
Until 7.2.1 controllers did not support Scope, that was only for External and Prefix. All controllers were local be default.