cancel
Showing results for 
Search instead for 
Did you mean: 

How to navigate from a Servlet to a WebDynpro?

thomas_blatt
Discoverer
0 Kudos

Hi together,

I've the following Problem:

On the same EP, there are 2 deployed components:

- a WebDynpro-Application with several Views, each in a separate iView

- a Servlet

Question:

How can i navigate from the Servlet to one special iView or CustomController of the WebDynpro-Application passing a Parameter?

I've tried to navigate using the WDPortalNavigation.navigateAbsolute()-Method, but when I create the Target-Url using the following Code, my Debugger leaves the Code uncontrolled:

deployableObjectPart = WDDeployableObject.getDeployableObjectPart("vendor/App", "webdynproApp",WDDeployableObjectPartType.APPLICATION);

urlToTargetApp = WDURLGenerator.getApplicationURL(deployableObjectPart);

Some Ideas?

Regard

Thomas

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hi Thomas,

urlToTargetApp should be used not in portal navigation but directly (by redirect for example) because it is url to WD application but not to portal iView.

Best regards, Maksim Rashchynski.

praveenkumar_kadi
Active Contributor
0 Kudos

Hi Thomas,

I think you may have to use session concept here.

check with following code

you can use the following code to set value to the parameter.

HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();

HttpSession session = request.getSession(true);

session.putValue("col_id", <value>);

This code below is used to get parameter value.

HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();

HttpSession session = request.getSession(true);

String Col_id =(String)session.getValue("col_id");

Let's say the pcd location of the target page is

pcd://portal_content/com.sap.pct/specialist/com.sap.test.pages/com.sap.test.target_pg

In the event handler for the onAction event of the button

String appParams = "ApplicationParameter=<your parameter name>=" + <put your value here>;

WDPortalNavigation.navigateAbsolute(

"ROLES://portal_content/com.sap.pct/specialist/com.sap.test.pages/com.sap.test.target_pg",

WDPortalNavigationMode.SHOW_INPLACE,

"",

"",

WDPortalNavigationHistoryMode.ALLOW_DUPLICATIONS,

"",

"",

appParams,

null,

true,

true);

For more details you check the following URL. it describes on how to navigate from html/servelt to portal iview.

Reward points if it helps

Regards

Praveen