Home Jsp Simple-jsp-example Literals in Jsp



Literals in Jsp
Posted on: February 9, 2008 at 12:00 AM
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.

Related Tags for Literals in Jsp:
cstringjspideclasstextprintingobjectiosedprintviexpressioncontentvaluenumberusingintthisidwritesimplecreaterowjstexprogramtoimplicitexpressramliteralscissiexteitlsliuseimliteralinasmntouttrjclesmemeanobjprodowhichwerwritersspeeessatincishamplpresspreeaarstrrowesimxpxtvatwssriringthavstaluhatjepleplprprintwriteronogro


More Tutorials from this section

Ask Questions?    Discuss: Literals in Jsp  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.