by Dinesh Thakur Category: Session

This example will explain that the HttpServletResponse setDateHeader() method is used to set date with header name.in the example we use util package that will allow us to access the mandatory library for date initializing on the web browser as output.

<%@ page import="java.util.*" %>

<html>

<head>

     <title>&lt;dateHeader&gt;In Jsp</title>

</head>

     <body>

     <center><br><b>

     <%

       long dt = new Date().getTime();

       response.setDateHeader("Date", dt);

       out.println("Date is : "+response.getHeader("Date"));

     %></b></center></br>

     </body>

     </html> 

         Jsp setDateHeader Example





About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.