Java Server Page is a web page document that integrate Java codes to generate a dynamic content. In this tutorial we will create a simple JSP that show the current time.
Open Eclipse, create a Dynamic Web Project, name it jsplabs and set Target runtime as Apache Tomcat v7.0.
Right click on the WebContent folder, select New→JSP file.
Name it first.jsp and click Finish
Insert the following codes between the <body> tags:
Play with some other functions, such as: application.getContextPath(); session.getCreationTime(); request.getRemoteHost(); request.getServerName(); request.getServerPort(); request.getContextPath(); request.getRemoteHost().
View some system property by using function: System.getProperty(“PROPERTY_NAME”). Replace PROPERTY_NAME by os.name, user.name, user.home, user.dir, user.timezone, java.home, java.version.