CS6320:  SW Engineering of Web Based Systems

 

Exercise 12: JSP Example (modified) from Core Servlet’s Book using JSP directive: page for importing classes.

  NOT COLLECTED

 

 

<HTML>

<HEAD>
<TITLE> JSP Directive: Import java.util package</TITLE>

</HEAD>
 
 <BODY>
   <H2> JSP Directive: Import java.util package</H2>

      <%@ page import="java.util.*" %>

      <%! 

        private String randomID() {

           int num = (int) (Math.random()*10000000.0);

           return("id" + num);

        }

       %>
   <UL>
   <LI>Your Random ID is: <%= randomID() %>
   </UL>
 </BODY>
</HTML>

Try IT!

© Lynne Grewe