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



Home Jsp Simple-jsp-example Literals in Jsp

Related Tutorials


 
 

Share on Google+Share on Google+

Literals in Jsp

Advertisement
Literals are the values, such as a number or a text string, that are written literally as part of a program code.

Literals in Jsp

        

Literals are the values, such as a number or a text string, that are written literally as part of a program code. A literal is a expression of a value, including a number or a text string.

In this simple jsp program we are using a literals. We are printing the literals by using the out implicit object, which is used to print the content on the brower. We have provided this object implicitly by the jsp. It means that we doesn't need to create a object of the PrintWriter class.

The code of the program is given below:

 

 

<html>
<head>
<title>Using Literals in Jsp</title>
</head>
<BODY>
    <H1>Using a Literal in Jsp</H1>
   
	 <%
	
	 out.println("Days of the weeks = " );
	  out.println(7);
	 %>
	 <br>
	 <%
	
	
	 out.println("Number of months = ");
	 out.println(12);
	 %>
  </BODY>
</html>

Output of the Program:

 

Download this example.

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

Related Tutorials

Discuss: Literals in Jsp  

Post your Comment


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