cancel
Showing results for 
Search instead for 
Did you mean: 

Portal Session Object in WebDynpro

Former Member
0 Kudos

Is there any way to access the Portal Session Object in a Web Dynpro App? What is the alternative method of storing some user specific data that is accessible across applications(other than storing that in a DB) in that same session?

Please let me know.

Thanks

Shakeel

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Perhaps the following lines of code answer your question:

IPortalComponentProfile profile = portalRequest.getComponentContext().getProfile();

profile.putValue(....);

profile.store();

Please tell me if it works - I have never tried it.

regards

Michael

Former Member
0 Kudos

Michael,

Unfortunately, this doesn't work in WebDynpro. The request/response/session objects are not exposed to the application.

Consider a scenario, where some data is generated in one application and I would like a few other apps to make use of this data across the same session.

Ideally, I would store the data in session scope so that other apps in the same session can always access the object and retrieve the data.

But given the limitations in WebDynpro, how do I achieve this without making backend visits and subscribing to events?

-Shakeel

Former Member
0 Kudos

Hi Shakeel,

ok, although i shouldn't do this, try the following lines, but even if it might help at the moment, <b>don't forget</b> you loose SAP support and your code will possibly fail in future releases:

if (WDPortalUtils.isRunningInPortal()) {
  IWebContextAdapter adapterInternal = (IWebContextAdapter) 
    WDWebContextAdapter.getWebContextAdapter();
  IPortalComponentRequest req = (IPortalComponentRequest) 
    adapterInternal.getOriginRequest();
  IPortalComponentResponse resp = (IPortalComponentResponse) 
    adapterInternal.getOriginResponse();
  IPortalComponentContext ctx = (IPortalComponentContext) 
    adapterInternal.getOriginContext();
}

Regards

Stefan

Former Member
0 Kudos

Hey Stefan,

This doesn't help either. How do I import the package containing the jar files of IPortalComponent* interfaces into my project?

I couldn't find any com.sapportals.* package on my computer.

Alternatively, I tried using the WDPortalNavigation.navigateAbsolute() method. The last parameter of this method supposedly shud contain the request object parameters in name value pairs. This one doesn't seem to be working either. I guess there is a problem in the way the URL of the target app is generated by this method. Coz, when I modify the URL of the target app to pass the parameters into the request object correctly, it works.

Any idea how this could be rectified?

Thanks

Shakeel

Former Member
0 Kudos

Hi Shakeel,

I was also searching for obtaining the Request object in Web Dynpro for my requirement. I found this link:

If your problem is not solved, have a look at this.

Hope this solves ur problem as well as my req.

Regards

Gaurav Gandhi

Former Member
0 Kudos

Hi Shakeel,

isn't the portal as the "launching" software component responsible for and able to store that data? AFAIK, the only thing WD runtime receives from the portal (in difference to running standalone) is an IPortalComponentRequest/Response instead of the corresponding "plain" HttpServletRequest/Response. But you won't reach the PortalReq/Resp since they are not exposed by the API.

Regards

Stefan