Hello experts,
I have read many posts in the forum to understand how to make this simple request, but I couldn't succeed.
In our SAP portal, the user calls a Web Dynpro Java to enter the "PRM" (custom name of the main business object type used in our system) on which he wants to work; all next subsequent actions (via role menus) will use this PRM. It's okay if these other actions are done using Web Dynpro Java (we use WDScopeUtil.put and WDScopeUtil.get to transfer the PRM).
The issue is about a Web Dynpro Java, which we want to replace with a JSP portal application; we need to retrieve the PRM from the JSP, via the HTTP session (because I don't know how to use WDScopeUtil in the JSP), but the JSP gets the null value.
The current situation is as follows:
1) I changed the "PRM input" web dynpro java to store the PRM in the current HTTP session:
HttpServletRequest param = (HttpServletRequest)WDProtocolAdapter.getProtocolAdapter().getRequestObject().getProtocolRequest();
HttpSession session = param.getSession();
session.setAttribute("prm", prm);
If I read the value within the Web Dynpro java, after setAttribute, by using getAttribute, it retrieves the PRM value correctly.
2) The JSP inherits AbstractPortalComponent, and contains the following code:
protected void doOnNodeReady(IPortalComponentRequest request, IEvent event){
HttpServletRequest request2 = request.getServletRequest();
HttpSession session = request2.getSession();
String prm = (String)session.getAttribute("prm");
Unfortunately, the PRM value retrieved is always a null value. I could make sure the ID of the session (method session.getId) is the same in both programs.
For information, here is the context: this web dynpro java is special, it's just used to do a redirection (WDPortalNavigation.navigateRelative) to the right web dynpro java based on the type of the PRM. We do a redirection because I was told it's not possible to branch to other web dynpros (via outbound plugs) if they are in different software components. PS: we want to replace it with a JSP so that to avoid the portal navigation which triggers a reload of the whole work area (below the top level navigation menu), consequently there's a double reload and a kind of flickering we want to avoid. PS 2: If I can't make the HTTP session work, I have one solution left for making it work, based on threads in the forum, it's the portal eventing.
Do you have any idea why the JSP gets a null value?
Thanks a lot.
Sandra