cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro URL-Invocation with umlauts (like %FC) in the url

Former Member
0 Kudos

Hi

My Web Dynpro Application is invoked by an url with a parameter "H_name", e. g.: http://

:

/webdynpro/dispatcher/../myApp?H_name=SomeName.

If the parameter H_name equals Müller, the Web Dynpro view will display it as M?ller, which is of course not what I want.

I tried to use the following code snippet:

IWDProtocolAdapter adapter= WDProtocolAdapter.getProtocolAdapter();

String name= adapter.getRequestObject().getParameter("H_name");

..but the "ü" is still missing.

What can I do???? Do I have to configure URL decoding somewhere?

Please help me with this issue!

Thanks a lot in advance

Kind regards

Bettina

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

While creating the url make use of

WDProtocolAdapter.getProtocolAdapter().encodeRedirectURL(url);

And to get the parameter use the following

WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter(key)

Some times it may help you.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj,

thank you very much for your time. I think I solved the problem by myself:

Web Dynpro expects the URL parameters in UTF-8-encoding. However, the parameters in the url with which we invoke the Web Dynpro Application are encoded with ISO 8859-1 (Latin-1)- encoding. Naturally, Web Dynpro doesn't decode it properly.

We have to make sure that all input parameters for Web Dynpro are UTF-8-encoded.

Example:

Umlaut "ö":

- in UTF-8 %C3%B6

- in ISO 8859-1: %F6

Kind regards.

Bettina

Former Member
0 Kudos

Hi,

try


String name_decoded= URLDecoder.decode(H_name, "ISO-8859-1")

as the encoding of your inputparameter isn't UTF-8 but ISO-8859-1.

regards

Frank

Former Member
0 Kudos

Hi

thanks for your suggestion. Unfortunately, this is not working, Web Dynpro is decoding the input parameters BEFORE they can be accessed from within the interface view. There's an internal conversion from the URL-parameter to the Interface View parameter.

Kind regards

Bettina

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Make use of the URLEncoder encode/decode methods

http://72.5.124.55/j2se/1.4.2/docs/api/java/net/URLEncoder.html

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj

thanks for your help. In class URLEncoder it says:

static String encode(String s, String enc) 
          Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme. 

What kind of encoding format should I choose?

I tried:


			String name_decoded= URLDecoder.decode(H_name, "UTF-8");
			System.out.println("name decoded " + name_decoded);

..but it's not working. Do you have an example?

Kind regards

Bettina

Former Member
0 Kudos

Hi,

Pl have a look at this page for some examples

http://www.w3.org/International/O-URL-code.html


 String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
        data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");


Regards

Ayyapparaj

Former Member
0 Kudos

Hello Ayyapparaj

thanks, but: I would like to DECODE, not ENCODE a string.

I have the following code inside the Interface View inside the startup plug which is called by the Web Dynpro Application:


			String name_decoded= URLDecoder.decode(H_name, "UTF-8");
			System.out.println("name decoded " + name_decoded);

And this does not return a valid Umlaut. What can I do?

Thank you and best regards

Bettina