In this Section, we will learn about using "getQueryString() " method to retrieve the 'query string'.
In this Section, we will learn about using "getQueryString() " method to retrieve the 'query string'.In this Section, we will learn about using "getQueryString() " method to retrieve the 'query string'.
The "getQueryString()" method is used to fetch the 'query string'. The query string contains the attribute & the value of the html or JSP form, which sends with the POST /GET method to Servlet or JSP page for any request.
Example : In this Example , we are asking user to enter any username and password string, the output displays the query string means username & password . The Query String is fetched using the method "getQueryString()".
|
< html> <head><title>getQueryString() method of request object.</title></head>out.println(request.getQueryString()); </ html> |
OUTPUT :

After Submitting Value the output should be :
