cancel
Showing results for 
Search instead for 
Did you mean: 

URL rewriting encodeRedirectURL()

Former Member
0 Kudos

first time when user enter page 1..the prno=0010012553,

while later on..user want to search the prno=0010012554

how do i change the xxx?prno=0010012554

page 1 (prno=0010012553,0010012554) ---> page 2

i have following url in address bar

can i use something


WDWebContextAdapter.getWebContextAdapter().encodeRedirectURL("http://localhost:50100/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012555");

how to reset URL...

WDWebContext ??

[detail page]

http://localhost:50100/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012553

when i click [back button] to navigate to [main page]

which allow user to key in the prno=0010012554

the url link still showing the ?prno=0010012555

how to i reset the url to

http://localhost:50100/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012554

Message was edited by:

yzme yzme

Message was edited by:

yzme yzme

Message was edited by:

yzme yzme

Message was edited by:

yzme yzme

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Let's see if I have got this correctly:

1. The first page is a PR detail with URL http://localhost:50100/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012553

2. On this page you have a "Back" button, on click of which you are firing a plug to go to a main view where the user can type in some other PR number that you want to search for.

If that's correct tell me what happens after that. How are you again showing the PR details from here?

Regards,

Satyajit.

Former Member
0 Kudos

you are correct...

on the main page user may key in any prno

and i want to reset the prno=?xxxx to something else

first time in the detail page..if i provides a link for user to login

http://localhost:50100/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012553

it will remain static....

i this detail page...

i will call

WDWebContextAdapter.getWebContextAdapter().getRequestParameter("prno");

to get the prno

if i navigate back and user enter the new prno...

and redirect to detail page...

the page still getting the old 0010012553 values, although user has enter new prno...

so i need to rewrite my url

Former Member
0 Kudos

yzme,

Probably I do not understand your question but...

You may only re-write URL via redirecting to new URL.

Use Exit plug on InterfaceView with Url parameter, fire this plug from some action handler with redirect URL as parameter. This will replace URL in browser. As a drawback, application will be restarted.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

silaev....you suggestion is good...

but how i i redirect..the URL as parameter...

pls give me the sample code

this not work for me...the url not change..

i put it in a button and trigger this

WDWebContextAdapter.getWebContextAdapter().encodeRedirectURL("http://localhost:50100/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012555");

Message was edited by:

yzme yzme

Former Member
0 Kudos

Yzme,

1. In Interface View controller of your application window create <b>outbound plug</b>, mark it as <b>exit plug</b>. Let us say its name is RedirectApplication

2. Add parameter <b>Url</b> of type <b>string</b> to plug.

3. In view controller add corresponding InterfaceView controller as required controller.

4. In button action handler write something similar to:


final String redirectUrl =
  WDWebContextAdapter
    .getWebContextAdapter()
      .encodeRedirectURL(
        "/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012555"
      );
wdThis.wdGet<InterfaceViewControllerName>().wdFireRedirectApplication(redirectUrl);

Here I assume that you are redirecting to application running on same server, hence I've ommited "http://localhost:50100" url prefix.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (1)

Answers (1)

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Yzme,

If you are trying to navigate between the webdynpro. Use Webdynpro navigation:

See this thread:

Regards, Suresh KB

Former Member
0 Kudos

http://localhost:50100/logon/logonServlet?redirectURL=%2Fwebdynpro%2Fdispatcher%2Fsap.com%2Fpr%2FPRa...

this is something that user login and redirect to the page...

Suresh KB...

you are giving me the portal navigation....

i only need a simple rewrite...

for instance

WDWebContextAdapter.getWebContextAdapter().getRequestParameter("prno");

is to get the parameter...

i need something

wdwebcontextadapter.xxxxxencodeurl or something to rewrite my url

becoz...after i put the link...

http://emi-sap:50100/webdynpro/dispatcher/sap.com/pr/PRapp?prno=0010012555

whenever i navigate forward or backward..the link remain static...

there is a situation user navigate to user pr no input page...where user can key in any prno and i want the link to change accordingly

prno=0010012556

prno=0010012557

...

...

and so on...