when using the GET method, parameter names and their values get submitted on the URL string after a question mark. Different parameter name/value pairs are separated by ampersands(&).
parameters are accessed from a request in an already decoded format (via request.getParameter()), so no decoding is necessary. However, occasionally certain situations arise where you need to decode a string that has been URL encoded (for instance, by the URLEncoder.encode(String s, String encoding) method or the javascript escape() function).
Output :
URL encoding is required much more often than URL decoding, since decoding usually takes place automatically during calls the request.getParameter(). However, it is good to know that URLDecoder.decode() exists for the occasional situation where it is needed.
parameters are accessed from a request in an already decoded format (via request.getParameter()), so no decoding is necessary. However, occasionally certain situations arise where you need to decode a string that has been URL encoded (for instance, by the URLEncoder.encode(String s, String encoding) method or the javascript escape() function).
Output :
URL encoding is required much more often than URL decoding, since decoding usually takes place automatically during calls the request.getParameter(). However, it is good to know that URLDecoder.decode() exists for the occasional situation where it is needed.
0 comments:
Post a Comment