Skip to Content
author's profile photo Former Member
Former Member

How to get a IPortalComponentRequest object ?

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 05:00 PM

    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 😉

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 07:50 PM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.