on 03-15-2005 8:49 AM
Hello,
Is it possible to cache the data in webdynpro for one user session something like what stateful EJB does?
Thanks.
Best Rgds
Rajeev
Hi!
It seems to work but sometime I get a ClassCastException when I cast the object from the get method. This only happens when I run my wdp from Netweaver studio.
My code is like:
IMaintainScope maintainer = Utils.getScopeMaintainer( WDScopeType.CLIENTSESSION_SCOPE );
Scope scope = maintainer.getScope();
MyClass x1=(MyClass)scope.get("myKey");
I solved it by catching the exception (java.lang.ClassCastException). This problem is minor as I think it only happens when the wdp is run from Netweaver studio...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you both for your reply.
I was talking about the user session which can keep the info even if the webdynpro application is destroyed but the user is still in portal on some other page. if he comes back to same webdynpro application again then I can retrieve the data i had saved prevously from database into client session.
I think Maksim code would help me out in that.
Please let me know if I am wrong.
Thank you
Rgds
Rajeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
...
FPI usage deleted.
Message was edited by: Maksim Rashchynski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maksim,
I tried your approach using CLIENTSESSION_SCOPE and was
able to leverage objects across applications.
I noticed that if I logged off using the Portal Logoff
and logged back in with the same Browser my Webdynpro session objects were still available.
Is there a way to clear the objects when invoking the Portals Logoff?
Thanks,
Hi Srinivasan,
I had added the appropriate servlet.jar to the build path when I built my application. I am able to use the variables from the session across applications. My issue is that when I use the Portal Logoff and come back to my application, the value of my session attributes are still valid in the session.
If I close the browser it's fine, otherwise the data still exists.
Thoughts?
Thanks,
John
Hallo,
there is no inbuilt, generic mechanism provided by the Web Dynpro Java Runtime which can be used to share data across several Web Dynpro client sessions.
I repeatedly refer to my WebLog on <a href="/people/bertram.ganz/blog/2005/02/02/never-ever-hijack-internal-web-dynpro-classes-and-interfaces">Never Ever Hijack Internal Web Dynpro Classes and Interfaces</a>. With the first new SAP NetWeaver Release your "hack-solution" won't work any more at all, because all internal FPIs like IMaintainScope, IScope will be hidden behind a Web Dynpro API Fassade, so that you cannot import the related packages within your controller classes at designtime any more.
Like Valery allready mentioned the proposed solution is to persist this session wide data in a database. To access this data you can either use a Web Service Model or you import a Java Bean Model which is a Command Bean Layer calling EJBs.
Regards, Bertram
Rajeev,
1. Nothing prevents you from using SFSB itself with WD.
2. There is no access (via API) to HTTP session in WD.
3. Lifecycle of WD Controllers (Custom Controller, Interface Controller, Component Controller and View Controller with <i>framework_controlled</i> lifespan policy) closely adheres to your needs -- all of them are created on demand and stay alive for component life-time. So unless you manually creates / destroy components via ComponentUsage from embedder component, you may use controller context or private variables as UI-level cache.
Regards,
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.