cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Redirect in Webdynpro

arunneerolil
Contributor
0 Kudos

Hi ,

I tried both the codes given in Weblogs for redirecting to another URL from a Webdynpro .

Code Sample 1

==============

HttpServletResponse request = ((com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter)

WDWebContextAdapter.getWebContextAdapter()).getHttpServletResponse();

String redirectUrl = "http://www.google.de";

try {

request.sendRedirect(redirectUrl);

} catch (IOException e) {

//@TODO: handle exception

e.printStackTrace();

Problem I faced

###############

No Errors but not performing redirection.

Code Sample 2

=================

IWebContextAdapter wca =

(IWebContextAdapter)WDWebContextAdapter.getWebContextAdapter();

String redirectUrl = "http://www.google.de";

wca.sendRedirect(redirectUrl);

Problem I faced

###############

Failed to IWebContextAdapter package. I searched for this class in NWS help but couldn't find.

I am using NWS-Ver2.0.3 and J2EE engine 6.3

Can anyone help?

Thanks in Advance

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member182372
Active Contributor
0 Kudos

Hello Chemmam,

check this

Best regards, Maksim Rashchynski

Former Member
0 Kudos

Chemmam,

Full class name is com.sap.tc.webdynpro.services.sal.adapter.core.IWebContextAdapter. It's available for any WD application in NW04 (however, it is not recommended to use while it's internal).

Try the approach with "Exit plug" with sole Url parameter.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi

Why dont u use linkToURL ui element. That should help you to move from one WDApp to another website like google. But if you want to do it dynamically within the code then your code, has to be IWDWebContextAdapter and not IWebContextAdapter i suppose.. Change it and see.

regards

Ravi