To set headers in the http response and check if specific headers are present, use the methods
addHeader(..),
addDateHeader(..),
addIntHeader(..) and
containsHeader(..) of the HttpServletResponse object.
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
resp.addHeader("lang", "english");
resp.addDateHeader("createTime", Calendar.getInstance().getTimeInMillis());
resp.addIntHeader("iteration", 8);
resp.containsHeader("lang");
}