Hi,
I'm working on the logon module of the portal (com.sap.portal.runtime.logon).
I want to connect this logon module to the CRM. To do this, I need to use a IPortalComponentRequest object from com.sapportals.portal.prt.component.jar jar file.
But into the logon module pages, the request is a HttpServletRequest.
Is there a way to get a IPortalComponentRequest or to convert a HttpServletRequest to a IPortalComponentRequest ?
Thanks
Jean-Philippe
Hi Jean-Philippe,
Try this code:
IPortalComponentRequest currentRequest = (IPortalComponentRequest)pageContext.getAttribute(javax.servlet.jsp.PageContext.REQUEST);
Greetings,
Praveen Gudapati
p.s. Points are always welcome for helpful answers 😉
Here is the code snippet, to get most of the objects from the HTTPRequestObject assuming <i><b>request </b></i>here is a HTTPRequest object
Object obj = request.getAttribute("com.sapportals.portal.prt.component.IPortalComponentRequest"); IPortalComponentRequest portalRequest = null; IPortalComponentContext componentContext = null; IPortalComponentProfile componentProfile = null; if(obj instanceof IPortalComponentRequest) { portalRequest = (IPortalComponentRequest)obj; componentContext = portalRequest.getComponentContext(); componentProfile = componentContext.getProfile(); String contextName = componentContext.getContextName(); }
<b></b>
Add a comment