Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
getParameterNames() Method Of The Request Object 
 

This section gives you the detailed explanation about the getParameterNames() method of the request object.

 

getParameterNames() Method Of The Request Object

                         

This section gives you the detailed explanation about the getParameterNames() method of the request object. You will learn more about the procedure of using the getParameterNames() method of the request object. Why the method used and how to use? All the things about the getParameterNames() method is explained in this section which facilitates you for working with the method in efficient manner.

This is the method of the request object used for getting the enumeration of the attributes of the html form. These values are later retrieved through the java programming language by enumerating the retrieved enumerated data by the method of the request object.

This section provides JSP file which complete code is given below, provides the facility of getting all the attribute name of the html form. When you will submit the html form, JSP code executes and shows all the parameter name from the query string by using the method getParameterNames() of the request object.

Syntax of the method is as follows:

Enumeration e = request.getParameterNames();

Above line of the code store the retrieved data (in the enumeration form) through the getParameterNames() method of the request object to the Enumeration type variable e.

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

<%@page import="java.util.*" %>
<html>
	<head><title>getParameterNames() method of request object.</title>
</head>
	<body>
		<form method="post">
			<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>
		<%
			String ParameterNames = "";
			for(Enumeration e = request.getParameterNames();
 e.hasMoreElements(); ){
				ParameterNames = (String)e.nextElement();
				out.println(ParameterNames + "<br/>");
			}
		%>
	</body>
</html>

Output for the above code:

Download the GetParameterNamesMethod.jsp file.

                         

» View all related tutorials
Related Tags: c string stl io sed arguments type jstl boolean tag return ole this oo check js if boo ie with

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

Hi,
i tried to download code for the GetParameterNamesMthod.jsp but it's not downloaded.
can any reply to me with coed for this........

Posted by prabha on Monday, 07.16.07 @ 18:21pm | #21393

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.