Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

getHeaderNames() Method Of The Request Object

In this section, you will learn how to get the header name of the host server.

Ads

getHeaderNames() Method Of The Request Object

     

In this section, you will learn how to get the header name of the host server. This section gives you the brief introduction about the getHeaderNames() method of the request object that is used for getting the name of all the header names existed in the current session environment of the page. This method returns all the header names in the enumeration form that are retrieved one by one by enumerating the data.

There is a example with the complete JSP code is provided by the section i.e. very helpful in developing your JSP application. You can directly copy from the page and paste it into your application.

Here is the JSP code of GetHeaderNamesMethod.jsp file:

<[email protected] import="java.util.*" %>
<table align="center" border="1" cellpadding="0" cellspacing="0" bgcolor="red">
<%
	String headername = "";
	for(Enumeration e = request.getHeaderNames(); e.hasMoreElements();){
		headername = (String)e.nextElement();
%>
	<tr>
		<td><b><%= headername %></b></td>
	</tr>
<%}%>

Output for the above JSP file:

Download JSP file.

Advertisements

Ads

Online Training Classes

Share on Google+Share on Google+

getHeaderNames() Method Of The Request Object

Posted on: February 9, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: getHeaderNames() Method Of The Request Object   View All Comments

Post your Comment


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

Ads

 

Ads