Home Jsp getQueryString() Method Of The Request Object



getQueryString() Method Of The Request Object
Posted on: December 18, 2008 at 12:00 AM
This section describes the getQueryString() method of the request object.

getQueryString() Method Of The Request Object

     

This section describes the getQueryString() method of the request object. Here, you will learn more about the getQueryString() method of the request like what's the need of the method and how to implement it into your JSP application code. You can directly copy the code and paste it into your JSP application code.

This method of the request object is used for getting the query string which is the values with the attribute of the html from where the jsp page is referenced. There all attribute of the form with form attributes is available in the query string.

Here is the JSP code of the getQueryString.jsp file:

<html>
	<head><title>getQueryString() method of request object.</title></head>
		<body>
		<form method="get">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>User Name: </td>
					<td><input type="text" size="20" name="txtUserName" />
				</tr>
				<tr>
					<td>Password: </td>
					<td><input type="password" size="20" name="txtPassword" />
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td><input type="submit" value="Submit" name="B1" /></td>
				</tr>
			</table>
		</form>
		<%
			if(request.getQueryString() != null)
				out.println(request.getQueryString());
		%>
	</body>
</html>

Output for the above JSP file:

Download the getQueryString.jsp file.

Related Tags for getQueryString() Method Of The Request Object:
cstringqueryjspapplicationobjectiomethodgetquerystringrequestintthisapplikejstolearneareilitdessectionliiminmntouttrcajesemmehowintoobjppcatdescribesspeeatquestkishallmpleaandarcodcodestrtqueryscrssriringthbesstabatiaphatjeicaicapleplndodeono


More Tutorials from this section

Ask Questions?    Discuss: getQueryString() Method Of The Request Object   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.