on 04-21-2008 1:47 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.