%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" session="true"%>
Insert title here
This is page three
<%
java.time.format.DateTimeFormatter dtf1 = java.time.format.DateTimeFormatter
.ofPattern("yyyy/MM/dd HH:mm:ss");
java.time.LocalDateTime now1 = java.time.LocalDateTime.now();
%>
Current time :
<%=now1%>
<%
session = request.getSession();
String nameVal = "null name";
String tmVal = "null time";
if (null != session.getAttribute("name")) {
nameVal = String.valueOf(session.getAttribute("name"));
}
//out.println("
3rd page : " + nameVal);
if (null != session.getAttribute("currTime")) {
tmVal = session.getAttribute("currTime").toString();
}
//out.println("
Time is : " + tmVal);
if ("Go Back".equals(request.getParameter("bSubmit"))) {
session.setAttribute("name", request.getParameter("tName"));
java.time.format.DateTimeFormatter dtf = java.time.format.DateTimeFormatter
.ofPattern("yyyy/MM/dd HH:mm:ss");
java.time.LocalDateTime now = java.time.LocalDateTime.now();
//System.out.println(dtf.format(now));
session.setAttribute("currTime", now);
%>
<%
}
%>