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
 
getHeaderNames() Method Of The Request Object 
 

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

 

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:

<%@page 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.

                         

» View all related tutorials
Related Tags: c client request display page name cli ie ref e li spl m nt play isp cl es age me

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
Although i m novice in JSP.The examples given r very useful.
thanks

Posted by sharib on Thursday, 06.28.07 @ 16:07pm | #20326

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.