Skip to Content
avatar image
Former Member

How to get Portal URL -- http://server:port/irj - from WebDynpro code

Hi Friends,

Could anyone please let me know how to get the Portal URL from the WebDynpro. I mean by Portal URL as -<u><i><b> http://myserver:port/irj</b></i></u>

Being irj as a webapplication, <b><i>how can we get this whole url from webdynpro?</i></b>

Thanks

Raghavendra

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Mar 19, 2007 at 09:10 PM

    Got Answer!! its a workaround. I added the servlet.jar to buildpath of project and used the below code. Only problem i have is , How to identify which protocol the portal is using. ie., http or https. Current url works for http

    String slHostName=TaskBinder.getCurrentTask().getProtocolAdapter().getServerName();

    String slPortNumber=String.valueOf(TaskBinder.getCurrentTask().getProtocolAdapter().getServerPort());

    wdContext.currentContextElement().setImgAnon("http://" + slHostName + ":" + slPortNumber + "/irj/go/km/docs/documents/CompImages/comp-logo.jpg");

    Thanks,

    Raghavendra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Here is a better way:

      IWDRequest req = WDProtocolAdapter.getProtocolAdapter().getRequestObject();

      int localPort = req.getServerPort();

      String localhost = req.getServerName();

  • avatar image
    Former Member
    Sep 28, 2008 at 03:24 AM

    If it is not recommended to use TaskBinder class, then why does SAP have it in their documentation?

    [HERE|http://help.sap.com/saphelp_nw04s/helpdata/en/bb/fdc4402418742ae10000000a155106/frameset.htm]

    Add comment
    10|10000 characters needed characters exceeded