Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
A query string is what follows the question mark in a URL.
It must NOT contain spaces as such !
This one consists of two parts, fullname and city, separated by & .
%20 indicates a space, URL-encoded, an alternative is + .
The entire string is retrieved this way.
Its parts can be accessed like this.
null, if it's not there.
Since JSP2.0 we can use the Expression Language, EL.
EL alternative ( Dollar sign + CURLY brackets ! ).
Easier EL alternatives for parameters.
Notice the syntax :
Most objects mentioned earlier, like session, application etc. can be reached through pageContext.
With the exception of
+ & % -
and a couple more, many characters need encoding to be used in a URL.
! has to be %21
@ has to be %40
A class that can do this for you, is
strencoded = URLEncoder.encode ( regularstr ) ;
It can also decode.