HttpServletRequest: getHeader( ) by Accept-Charset : HttpServletRequest « javax.servlet.http « Java by API






HttpServletRequest: getHeader( ) by Accept-Charset

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Hello extends HttpServlet {

  public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,
      IOException {
    String acceptLanguage = req.getHeader("Accept-Language");
    String acceptCharset = req.getHeader("Accept-Charset");

    res.getOutputStream().println("acceptLanguage: " + acceptLanguage);
    res.getOutputStream().println("acceptCharset" + acceptCharset);
  }
}

           
       








Related examples in the same category

1.HttpServletRequest: getAuthType()
2.HttpServletRequest: getCookies()
3.HttpServletRequest: getHeaders(String name)
4.HttpServletRequest: getHeader( ) by Accept-Language
5.HttpServletRequest: getRequestURI()
6.ServletRequest: getReader()
7.ServletRequest: getRequestDispatcher(String arg0)
8.HttpServletRequest: getHeaderNames()
9.HttpServletRequest: getPathInfo()
10.HttpServletRequest: getPathTranslated()
11.HttpServletRequest: getQueryString()
12.HttpServletRequest: getRemoteUser()
13.HttpServletRequest: getSession()
14.HttpServletRequest: getUserPrincipal()
15.HttpServletRequest: isRequestedSessionIdFromCookie()
16.HttpServletRequest: isRequestedSessionIdFromURL()
17.HttpServletRequest: isRequestedSessionIdValid()
18.HttpServletRequest: isUserInRole(String arg0)