<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" session="true"%> <%-- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> --%> Insert title here <% session = request.getSession(); String sessionValue = "null Name....."; if (null != session.getAttribute("name")) { sessionValue = (String) session.getAttribute("name"); } if ("Start".equals(request.getParameter("bSubmit"))) { session.setAttribute("name", request.getParameter("tName")); java.time.format.DateTimeFormatter dtf1 = java.time.format.DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); java.time.LocalDateTime now1 = java.time.LocalDateTime.now(); session.setAttribute("currTime", now1); %> <% } %>
Welcome to Session Testing

<% java.time.format.DateTimeFormatter dtf = java.time.format.DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); java.time.LocalDateTime now = java.time.LocalDateTime.now(); %> Current time : <%=now%>


<%--
Enter Name :"> --%>