Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions? | Software Development
 

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.

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.

 

                         

» View all related tutorials
Related Tags: java c string jsp ide class strings script object io objects method get char ip using sequence id declaration length

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.