cancel
Showing results for 
Search instead for 
Did you mean: 

Reading URL Parameter

Former Member
0 Kudos

Dear Experts

I have created a webdynpro ivew, and added a Quick link to it and added to the workset. So that I can acccess the ivews form URL. I need to pass the URL paramenter also

like

http://<Server Name>:<portNumber>/irj/portal/Quick link?param1=Value, Now I need to read the param1 value in my Webdynpro code.

When i set the value in Application parameter I was able to get the value using the following code

path=WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("path");

My Question in how to get the value which is given in URL parameter

Regards

Noel

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Dear Expert

Finally I got the result by setting

DynamicParameter=param=value

in the Query String to sending the paramenter

and in receiver end I tried

WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("paramr");

Regards

Noel

Former Member
0 Kudos

Hi,

use this one,

WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("param1");

Regards,

sunaina Reddy T

gill367
Active Contributor
0 Kudos

HI Noel,

use the following code in your wddoinit() method.

if ((WDProtocolAdapter.getProtocolAdapter().getRequestObject()
		.getParameter("param")
		!= null)
		&& (!WDProtocolAdapter
		.getProtocolAdapter()
		.getRequestObject()
		.getParameter("param")
	.equalsIgnoreCase(""))) {

String str = WDProtocolAdapter
                                                .getProtocolAdapter()
		.getRequestObject()
		.getParameter("param") ;

}

Regards,

sarbjeet singh

Former Member
0 Kudos

Hi ,,

You can use the following :

if the url is : http://<Server Name>:<portNumber>/irj/portal/Quick link?param1=Value,

String param =WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("param1");

Thanks

Ritushree

Former Member
0 Kudos

Dear Ritu,

I have used this code but no use I am getting null value. This is working if we give the parameter in I vew property as application parameter.

It is not working for the parameter given in URL as ?param1=value

Regards

Noel

Former Member
0 Kudos

Hi

Try using this code i the Webdynpro Application :

String param = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("param1");

Regards

Ishita

Abhinav_Sharma
Contributor
0 Kudos

Hi

I think the code that you mentioned should works. I observe one thing that in getParameter you mentioned path as an argument. You need to mention the application parameter name.

Also, if you run the webdynpro application standalone you will not get its iView application parameter. You should only run the iView in portal or in preview mode to get the desired value.

Following code can help you in listing down all the application parameters that a webdynpro iview can contain. If you mentioned your parameter it will display the same too:

Enumeration enum =

WDProtocolAdapter

.getProtocolAdapter()

.getRequestObject()

.getParameterNames();

for (Enumeration e = enum; e.hasMoreElements();) {

wdComponentAPI.getMessageManager().reportSuccess(

"iView Params::" + e.nextElement());

}

Coming back to your problem, suppose you have application parameter set as ivuParam then you can get its value as

String ivuParam =

WDProtocolAdapter

.getProtocolAdapter()

.getRequestObject()

.getParameter(

"ivuParam");

Hope this helps.

Abhinav

Abhinav_Sharma
Contributor
0 Kudos

Hi

Can u provide what version of Portal you are using? These are certain limitations which is mentioned in the link below

[|]

Abhinav

Former Member
0 Kudos

Hi Abnivav

I am Using SP 18 in SAP Netweaver 7, So what command do I need to use in this version

Regards

Noel