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

Url of the current component

Hi Guys,

I've developped a component using the PDK. In runtime, when running this component, can this component have access to its own url?

how?

Best regards,

Marc

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 11, 2005 at 12:37 PM

    Hi Marc,

    this worked for me (inside a JSPDynPage), in a servlet you should be able to access the HttpServletRequest directly:

    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import javax.servlet.http.HttpServletRequest;
    
    ...
    
    IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();
    HttpServletRequest servletrequest = request.getServletRequest();
    ...
    String url = servletrequest.getScheme() + "://";
    url += servletrequest.getServerName();
    url += ":" + servletrequest.getServerPort();
    url += servletrequest.getRequestURI();

    Hope it helps ...

    Best regards,

    Kilian

     
    

    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.