Wednesday, April 15, 2009

Exercises 3 lab 1

Write a program to display the current date and the session Id.

Solution:
<html>
<head>
<title>JSP Example</title>
</head>
<body>
<LI>Today’s date is: <%= new java.util.Date() %>
<LI>Session Id:<%= session.getId() %>
</body>
</html>

The output of the program is as shown in Figure 2.3.

Figure 2.3: Output of SessionId.jsp

0 nhận xét: