on 12-16-2008 5:45 PM
I'm unable to retrieve the Special Chars from URL parameters. Does someone have an idea where to look for?
Examples where no Special Chars is retrieved :
...App?param=Aménagement
...App?param=Am<é>nagement
...App?param=Am%E9nagement
I'm using this code :
IWDProtocolAdapter protocolAdapter =
WDProtocolAdapter.getProtocolAdapter();
IWDRequest request = protocolAdapter.getRequestObject();
String param = request.getParameter("param");
Thanks!
Hi,
I would suggest you to use the URL encoder and encode the parameters before they are appended to the URL.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
okay, So if I use :
...App?param=Am%E9+nagement
How would you then integrate URLDecoder.decode in the following code?
IWDProtocolAdapter protocolAdapter =
WDProtocolAdapter.getProtocolAdapter();
IWDRequest request = protocolAdapter.getRequestObject();
String param = request.getParameter("param");
Emmanuelle, as a rule of thumb any non alphanumeric character should be URL encoded.
Try using Java URLEncoder class.
Example:
String toSend = "The \"quick\" brown\nfox.";
// encoding a String
String send = URLEncoder.encode( toSend, "UTF-8" );
// decoding the String
String reconstituted = URLDecoder.decode( received, "UTF-8" );
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.