cancel
Showing results for 
Search instead for 
Did you mean: 

HttpSession equivalent in WebDynpro

Former Member
0 Kudos

Hi,

1)What is the HttpSession object equivalent in WebDynpro? We need to use feature to store and retrieve some information in user session so that it can be used across multiple webDynpro applications for the user.

2) We would also need to store some information in memmory in application level so that it can be used in multiple applications for all users. Please advice how to achieve this in WebDynpro? Is there any "application" level scope for memmory objects in WebDynpro?

Pls help

regards,

Sujesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sujesh,

Check out the WDScopeUtil class. It has put and get methods for setting properties at the desired scope, similar to HttpSession.

public static void put(WDScopeType scopeType,
                       java.lang.String key,
                       java.lang.String value)

Method put puts the value into the specified scope. Consider the danger of name clashes when generating the keys. All application instances could share the same scope dependent of the scope type.

public static java.lang.String get(WDScopeType scopeType,
                                   java.lang.String key)

Method get reads the value from the specified scope.

For example:

WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, "Your Property Here");

Let us know how it works.

-Kelly

Former Member
0 Kudos

Hi,

Using Scope is not the answer. This is an internal WD class and will not be supported in future. Please see Bertram Ganz's blog titled <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>.

Regards,

Satyajit.

Former Member
0 Kudos

WDScopeUtil and -Type are part of the API, WDScopeType.CLIENTSESSION_SCOPE is deprecated.

Armin

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

1. WDProtocolAdapter if NW04s. It gives u IWDRequest back. You dont have to add the servlet.jar file in your build path.

2. Use DCs and store the data in the Context (normal and external mapping) and pass it across components. Think Components not application when it comes to WebDynpro.

You still have plug parameters incase you dont like thwe Context!!

regards

LNV

Former Member
0 Kudos

Hi,

There is no inbuilt mechanism provided by Web Dynpro which can be used to share data across several Web Dynpro client sessions. But you can try using the following code:

HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();	
HttpServletResponse response = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletResponse();
HttpSession sesion = request.getSession();

Also you can try using the <i>setTransientAttribute()</i> and the <i>getTransientAttribute()</i> of the IUser interface.

Regards,

Satyajit.