Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get all values using get paremeters in java

I'm passing the some values url from flex to java example: URL format:

../mahesh/initUser.do?method=fwdAccDetails&securityId=mUuB3/p/ky5JhZPY5T8Znf01YCcIarIalQiGEXPMMsOkWDX+KtT4fx2gMML+uup8

After I'm tiring to get "securityId" values in java like

request.getParameter("securityId")

But I'm getting following values only

mUuB3/p/ky5JhZPY5T8Znf01YCcIarIalQiGEXPMMsOkWDX KtT4fx2gMML uup8

  • symbol getting empty space in java side..

Here is my Flex code:

navigateToURL(new URLRequest('../mahesh/initUser.do?method=fwdAccDetails&securityId='+value+'),'_s‌​elf');

I didn't get full values.. any one can help me how I will get correct values in Java..

like image 685
Mahesh Avatar asked Dec 21 '25 16:12

Mahesh


1 Answers

You should use the encodeURIComponent()-Function to properly encode your securityId.

value = encodeURIComponent(value);
navigateToURL(new URLRequest('../mahesh/initUser.do?method=fwdAccDetails&securityId='+value+'),'_s‌​elf');

That way your String will be correct on the Java side.

If you want to read more about proper escaping, have a look at When are you supposed to use escape instead of encodeURI / encodeURIComponent? (Same arguments apply for Flex and JavaScript).

like image 157
Gregor Avatar answered Dec 24 '25 04:12

Gregor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!