Skip to Content
avatar image
Former Member

Using sessions to pass values between two iviews.

Hi,

I am trying to pass a variable value from a JSPDynpage based iview to a webdynpro based iview.

I am using Httpsession and storing the value in it.

Although Iam able to access the session from both components the value somehow gets lost.

Below is the code I have written for the same :

<b>JSPDynapge : </b>

IPortalComponentRequest req = (IPortalComponentRequest)this.getRequest();

IPortalComponentResponse res= (IPortalComponentResponse)this.getResponse();

HttpSession session =

req.getServletRequest().getSession();

session.setAttribute("Employee_Id","12345678");

req.getServletResponse(true).sendRedirect("/irj/portal");

<b>Webdynpro : </b>

HttpSession session = ((com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter)WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest().getSession();

String abc = (String)session.getAttribute("Employee_Id");

The value it shows in webdynpro is NULL.

Could somebody tell me where I am going wrong,or is there any other approach for the same problem.

Regards,

Kshitij Agrawal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 04, 2006 at 11:13 AM

    Hi ,

    One doubt,why dont you use portal client eventing supported by Portal runtime.

    you can raise event from JspDynpage

    EPCM.raiseEvent('urn:....' , 'MethodName' , evtData);

    In your webdynpro subscripe to this portal eventing

    WDPortalEventing.subscribe("urn:..." , "MethodName" ,wdThis.wdGetEvenBinnenAction());

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Now after 6 years, when i come across this forum while searching SDN.

      The problem here was that JspDynpage URN is urn:com.EPCMEvent

      WebDynpro subscription urn is urn:com.sap.EPCMEvent"

      They are not matching(see the .sap added in WebDynpro URN ).

      This was the reason why the event was not triggering.

      I have edited this just for the sake of the people who come across this forum with simillar problem.