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:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: February 9, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles