Home Jsp How to Create JSP Page
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

How to Create JSP Page

Advertisement
In this section we will show you how you can create JSP page and then test on tomcat server. Creating a new JSP page is very simple and any text editor can be used.

How to Create JSP Page

     

In this section we will show you how you can create JSP page and then test on tomcat server. Creating a new JSP page is very simple and any text editor can be used.

In this example I will show you how to create a simple JSP page that prints current date and time on the browser.

Java date class is used to get the current date and then print on the web browser.

Steps to Create JSP page:

Step 1:

Open note page and then paste the following in the note pad.

<%@page contentType="text/html" import="java.util.*" %>

<!--

http://www.roseindia.net/jsp

-->

<html>
<body>
<p>
&nbsp;</p>
<div align=
"center">
<center>
<table border=
"0" cellpadding="0" cellspacing
=
"0" width="460" bgcolor="#EEFFCA">

<tr>
<td width=
"100%"><font size="6" color
=
"#008000">&nbsp;Date Example</font></td>

</tr>
<tr>
<td width=
"100%"><b>&nbsp;Current Date 
and time is:&nbsp;
<font color="#FF0000">


<%= new java.util.Date() %>
</font></b></td>
</tr>
</table>
</center>
</div>

</body>
</html>

Step 2:

Save the file and enter the file name "date.jsp" and click on the "Save" button.

 

Note that the file name is enclosed in double quotes "date.jsp".

Step 3:

Now deploy the application and test it. If you don't have any experience in tomcat, learn it at our Tomcat Tutorial page.

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


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: November 1, 2008

Related Tutorials

Ask Questions?    Discuss: How to Create JSP Page   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Deepa
February 7, 2013
jsp name in quotes

Why do we give the jsp name in quotes ? Is this windows-specific ? Thanks !!
praveen nishad
November 25, 2012
want to build a website with database connectivity

I only know vb6 and java script how i create a website that connect with database simply . . code i want..
vinoth
August 12, 2013
thank u

Very much for helpful for me..thnk u
DMCA.com