Till now you learned about the JSP syntax, now I will show you how to create a simple dynamic JSP page that prints the current date and time. So the following code accomplish this:
The heart of this example is Date() function of the java.util package which returns the current data and time.
In the JSP Declaratives
<[email protected] contentType="text/html" import="java.util.*" %>
we are importing the java.util package and following JSP Expression code
<%= new java.util.Date() %>
prints the current date on the page.
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: January 30, 2005 If you enjoyed this post then why not add us on Google+? Add us to your Circles