Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

How To Use JSP Directives

Share this post!
 Vote this!

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>
The first line in the above example is called a "directive".  A JSP "directive" starts with <%@ characters.  more...

0 comments:

Post a Comment