Request headers provide configuration information of the browser.It may include accepting media types,accepting encoding types of browser,types of browser.

The following are some common request headers.

  1. Accept:
    Accepting media type of browser.
  2. Accept-encoding:
    By using this request header server can send compressed data as response,So that we can reduce download time.
  3. User Agent:
    By using User-Agent request header we can send compatible response for every browser.
  4. Cookie
    By using Cookie request header we can send session information to the server.So that session management is possible. تداول الاسهم الراجحي الجديدة HttpServletRequest contains the following methods to retrieve request headers at server side.

  1. String getHeader(String name)
  2. Enumeration getHeaders(string hname)
  3. Enumeration getHeaderNames() اسهم كويتيه مضمونه String getHeader(String name)

  1. Returns the value associated with specified header.
  2. If the header associated with multiple values then first value will be returned.
  3. If the specified header is not available this method returns null.
  4. Argument is not case sensitive اسواق الاسهم السعودية Enumeration getHeader(string hname)

  1. Returns all values associated with the header.
  2. If the request doesn’t contain specified headers this method returns empty enumeration object but not null.
  3. Argument is not case sensitive مواعيد العمل في سوق الاسهم السعودي Enumeration getHeaderNames()

Returns all header names associated with the request forex market reviews
Some request header as can be associated with int and date values.

To access these headers HttpServletRequest defines the more convenient methods.

  1. تجارة الذهب الخام public int getIntHeader(string hname) hafid zaini instaforex int length =req.getIntHeader(“content-length”);
    If the specified header not associated with int value this method raises grafici forex multipli in tempo reale NumberFormatException.
  2. طريقة بيع الاسهم عن طريق النت البنك الاهلي public long getDateHeader(string hname)
    Returns the date value as the number of milliseconds since 1970 jan 1st mid night. If we are passing this long value to the date constructor we will get exact date. التداول في الذهب السعودية Date d= new Date(long l)
    If the specified header not associated with date ,then this method returns اسعار جميع الاسهم السعودية اليوم IllegalArgumentException. كيف البيع والشراء في الاسهم Example:

  1. Create servlet that extends HttpServlet
  2. Create web.xml
  3. Create war file and deploy web application
  4. Output of web application
  5. Download web application

سوق الاسهم السعودية تداول اليوم Create servlet that extends HttpServlet

package com.java2learn;

import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class RequestHeaderDemo extends HttpServlet {

	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {

		PrintWriter out = resp.getWriter();

		Enumeration e = req.getHeaderNames();
		while (e.hasMoreElements()) {
			String hname = (String) e.nextElement();
			String hvalue = req.getHeader(hname);
			out.println(hname + "....." + hvalue);



موقع لتداول الاسهم جميع الاوقات Create web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi=""
	xmlns="" xmlns:web=""
	id="WebApp_ID" version="2.5">



Final application structure


Create war file and deploy the application شاشة عرض الاسهم السعودية Output
outputHeader تقييم شركات الفوركس Download Project: WebApp

Retrieving cookies from request

HttpservletRequest defines getCookies() method to retrive cookies at server sie.

Cookie[] c= req.getCookies();