Home Jsp getQueryString() Method Of The Request Object
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

getQueryString() Method Of The Request Object

Advertisement
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.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 18, 2008

Related Tutorials

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

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com