|
@@ -0,0 +1,85 @@
|
|
|
|
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
|
|
|
|
+ pageEncoding="ISO-8859-1" session="true"%>
|
|
|
|
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
+<html>
|
|
|
|
+<head>
|
|
|
|
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
|
|
+<title>Insert title here</title>
|
|
|
|
+</head>
|
|
|
|
+
|
|
|
|
+<body>
|
|
|
|
+ <center>
|
|
|
|
+ <font color="red" size=5><u>This is page two</u></font>
|
|
|
|
+
|
|
|
|
+ <br /><br/>
|
|
|
|
+ <%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%></center>
|
|
|
|
+ <br />
|
|
|
|
+
|
|
|
|
+ <%
|
|
|
|
+
|
|
|
|
+ session = request.getSession();
|
|
|
|
+ //out.println("val = " + sessionFromReq);
|
|
|
|
+ %><br/><br/>
|
|
|
|
+ <%
|
|
|
|
+ //out.println("val of session = " + session);
|
|
|
|
+
|
|
|
|
+ //out.println("val of session = " + session);
|
|
|
|
+
|
|
|
|
+ String nameVal = "null Name";
|
|
|
|
+ String tmVal = "null Time";
|
|
|
|
+ if (null != session.getAttribute("name")) {
|
|
|
|
+ nameVal = String.valueOf(session.getAttribute("name"));
|
|
|
|
+ }
|
|
|
|
+ //out.println("<br/>Input Text : " + nameVal);
|
|
|
|
+ if (null != session.getAttribute("currTime")) {
|
|
|
|
+ tmVal = session.getAttribute("currTime").toString();
|
|
|
|
+ }
|
|
|
|
+ //out.println("<br/><br/>Time : " + tmVal + "<br/>");
|
|
|
|
+ //String nameFromPage3 = String.valueOf(session.getAttribute("nameFromPage3"));
|
|
|
|
+
|
|
|
|
+ if ("Go to page 3".equals(request.getParameter("bSubmit"))) {
|
|
|
|
+ %>
|
|
|
|
+ <jsp:forward page="thirdpage.jsp" />
|
|
|
|
+ <%
|
|
|
|
+ }if ("Go to page 1".equals(request.getParameter("bBack"))) {
|
|
|
|
+ %>
|
|
|
|
+<jsp:forward page="index.jsp" />
|
|
|
|
+<%} %>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <form action="home.jsp" method="get">
|
|
|
|
+ <br /> <br />
|
|
|
|
+ <table align="center">
|
|
|
|
+ <%
|
|
|
|
+
|
|
|
|
+ %>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>Session Text :</td>
|
|
|
|
+ <td><%=nameVal%></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>Session Time :</td>
|
|
|
|
+ <td><%=tmVal%></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td><input type="submit" name="bBack"
|
|
|
|
+ value="Go to page 1"></td>
|
|
|
|
+ <td><input type="submit" name="bSubmit"
|
|
|
|
+ value="Go to page 3"></td>
|
|
|
|
+ </tr>
|
|
|
|
+ </table>
|
|
|
|
+ </form>
|
|
|
|
+</body>
|
|
|
|
+</html>
|