Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Jsp Simple-jsp-example The Quintessential in JSP

Related Tutorials


 
 

Share on Google+Share on Google+

The Quintessential in JSP

Advertisement
Quentessential means representing the perfect example of a class or quality.

The Quintessential in JSP

        

Quentessential means representing the perfect example of a class or quality. It is pure and concentrated essence of a substance.

A Jsp page consists of template text with embedded Jsp elements. Template text is automatically written to the output stream while the embedded Jsp elements are executed. In computer science Template means a document or file having a preset format, used as a starting point for a particular application so that the format does not have to be recreated each time it is created. Here is the simple Jsp page.

 

The code of the program is given below:

 

 

<%@ page import = "java.util.Date"%>
	<html>
    <head>
        <title>The Quintessential JSP Page</title>
    </head>
    <body>
    <pre>
    This is just a template text, It is going to be write automatically.
    stream.
    <hr>
    This is the jsp comment
    <%-- This is a JSP comment --%>
    <hr>
    The business logic of the program will be written inside the scriptlet directive.
    <%  for(int i=0; i<10; i++)
		out.println("The value of i is" + i);
    %>
    <hr>
    The following is a directive that includes other files:
    <%@ include file="Date.jsp" %>
    <hr>
    The Date is printed inside the JSP expression directive.
    The current date is <%= new Date() %>
    </pre>
    </body>

The output of the program is given below:

Download this example:

Advertisements

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: February 7, 2008

Related Tutorials

Discuss: The Quintessential in JSP  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com