Home Tutorial Java Jsp Display current time & system properties using JSP expressions

 
 

Share on Google+Share on Google+
Display current time & system properties using JSP expressions
Posted on: June 10, 2010 at 12:00 AM
Advertisement
In this Section ,we will display current time and system properties using JSP expressions.

Display current time & system properties using JSP expressions

In this Section ,we will display current time and system properties using JSP expressions.

Description of the program

<%= new java.util.Date() %>

This JSP expression display current date.

 

<%= System.getProperty("java.version")%>

This JSP expression display  currently installed version of java development kit.

 

<%= System.getProperty("java.home")%>

This JSP expression display "jre" directory URL.

 

 <%= System.getProperty("user.name")%>

This JSP expression display the name of currently logged on "user".

 

<%= System.getProperty("os.name")%>

This JSP expression display the name of the currently installed O.S. on system.

<%= System.getProperty("user.dir")%>

This JSP expression display the name of user directory, where your IDE is installed.

 

The code for the following program :

<HTML>

<head><title>DISPLAY DATE & SYSTEM PROPERTY</title></head>

<BODY>

Hello! The time is now <%= new java.util.Date() %>

<br>Java version :  <%= System.getProperty("java.version")%>

<br>Java home :     <%= System.getProperty("java.home")%>

<br>user name :     <%= System.getProperty("user.name")%>

<br>OS name :        <%= System.getProperty("os.name")%>

<br>user dir :           <%= System.getProperty("user.dir")%>

</BODY>

</HTML>

 

Output :

Advertisement

Related Tags for Display current time & system properties using JSP expressions :


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 10, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com