/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. <HTML><HEAD><TITLE

2. JSP Session 1 

3. </TITLE></HEAD

4. <BODY

5. <h2

6.  

7. A user session has been created at  <u> 

8.   <%= session.getCreationTime() %>  </u> 

9. server-time 

10. <br

11. with ID  <u> 

12.   <%= session.getId() %> 

13. </u><br

14. last access :  <u> 

15.   <%= session.getLastAccessedTime() %>  </u> 

16. server-time 

17. <br

18. Will stay alive for  <u> 

19.   <%= session.getMaxInactiveInterval() %> 

20. </u> seconds if not accessed . 

21. <br

22. <% 

23.   if ( session.getAttribute("Order1")== null

24.   {  session.setAttribute ( "Order1", "Beautiful weather"  ) ; 

25. %> 

26. Nothing ordered yet. 

27. <% 

28.   } 

29.   else 

30.   { 

31.     out.print  

32.     ( session.getAttribute("Order1") ); 

33. %> 

34. ordered . 

35. <% 

36.   } 

37. %> 

38.  

39. </h2

40. ${ pageContext.session.creationTime } 

41. ${ sessionScope.Order1

42. ${ Order1

43.  

44. </BODY></HTML

45. <%-- 

46. <% @page session="false" %> 

47. ========== 

48. 1. pageScope 

49. 2. requestScope 

50. 3. sessionScope 

51. 4. applicationScope 

52. ========== 

53. header 

54. headerValues 

55. initParam 

56. cookie 

57.  

58. --%>