Skip to Content
avatar image
Former Member

Help with redirecting URL from Web Dynpro

Hi,

I have a question regarding how i can construct a URL where i would like to forward the user from a WD app based on some user interaction.

The problem is that i need to know the protocol, server & host to resend the control to ( basically append these values to a url path that i have eg: <http(s)>://<host>:<port>/<the path i have>). With NW2004s, the request object is not exposed to us anymore, so i am wondering what is the best way to construct the url.

I have gone through various posts here and the one that came closest to accomplishing what i need is the one by Valery S which recommends creating a Servlet that captures the request info that i need and then calling the WD app including the info that i need as request parameters in the calling URL.

Before i do this, i want to see if anyone has been able to solve this through another approach.

Appreciate the inputs.

Best Regards

Renchy Thomas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 10, 2007 at 06:30 AM

    Renchy,

    Did you try using WDProtocolAdapter API for capturing the request object related stuff? You can get the request parameters like this:

    WDWebContextAdapter.getWebContextAdapter().getRequestParameter("<key>")

    You can get the host / port of the server using the TaskBinder API and then you can construct your URL.

    String serverName = TaskBinder.getCurrentTask().getProtocolAdapter().getServerName();
    int currentPort = TaskBinder.getCurrentTask().getProtocolAdapter().getServerPort();

    Bala

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 11, 2007 at 10:10 AM

    Renchy,

    To construct redirect URL that resides on the same server you do not need protocol/host/port.

    Just fire an Exit plug with "Url" parameter (type string) where Url is relative Url on server -- something like /somePath?a=1&b=2

    Check WebDynpro tutorials section on SDN for more details on <i>inter-application navigation</i>

    Valery Silaev

    SaM Solutions

    http://www.sam-solutions.net

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 11, 2007 at 05:42 PM

    Valery,

    Thanks for the response.

    I know, within the server, it is easier to redirect. Infact i am already doing that. But i need to send the app control to another server which is a content management system. The WDProtocolAdapter interface doesn't give us the info regarding the protocol/host/port. As you pointed out to Bala's post, i can't use the TaskBinder interface too.

    How do we get the protocol/host/port info. What is the reason to hide this info from the developers?

    Thanks for the help.

    Regards

    Renchy

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      In the below option:

      <b>1. HTTPDestination -- you are setting and configuring destination via VisualAdministrator, then from your code you are lookup destinitation by logical name and get physical URL.</b>

      How do we lookup the destination by logical name? Can you please provide the code snippet?

      Thanks,

  • avatar image
    Former Member
    Mar 12, 2007 at 06:46 PM

    Valery,

    Actually, you got me wrong about the need to get the protocol/host/port of the server i need to send the call back to. Why i need to get it (from the request object or any where else) is that because the WD application gets called from a content management system that is on a different server and hence the need to send the call back.

    I guess the HTTPDestination approach is difinitely an option, but does add the need to maintain the httpdestination everytime it changes in the future.

    Thanks again.

    Regards

    Renchy Thomas

    Add comment
    10|10000 characters needed characters exceeded

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

    Valery,

    If it is not recommended to use TaskBinder, 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