Showing posts with label Basic lesson 6:- Directives in JSP. Show all posts
Showing posts with label Basic lesson 6:- Directives in JSP. Show all posts

Thursday, August 22, 2013

Basic lesson 6:- Directives in JSP

We have been fully qualifying the java.util.Date in the examples in the previous sections.  Perhaps you wondered why we don't just import java.util.*;
It is possible to use "import" statements in JSPs, but the syntax is a little different from normal Java.  Try the following example:
<%@ page import="java.util.*" %>
<HTML>
<BODY>
<%
    System.out.println( "Evaluating date now" );
    Date date = new Date();
%>
Hello!  The time is now <%= date %>
</BODY>
</HTML>