View RSS Feed

JSP

Expressions in JSP

Rate this Entry
by
JSP
, 07-07-2012 at 07:09 PM (1472 Views)
The expression elements are supported by the JSP Page which:

Are based on scripting language
These expressions are evaluated.
These expressions are coverted to a String format
These are replaced with the expression elements in the JSP Page.

The expression elements in a JSP page are finally converted to a string so you can use it anywhere in your JSP Page. These expression elements must be valid and follow the Java Language. There is only one restriction that you can terminate a line with seimicolon as we usually do in a Java statement.

Following is an example of your JSP Expression Element:
Java Code:
<%= your expression %>
Also you can write the above expression element in following XML supported format:
Java Code:
<jsp:expression>
	Your expression
</jsp:expression>
The below code represents and example of JSP Expression.
Java Code:
<html> 
<body>
   Date: <%= (new java.util.Date()).toLocaleString()%>
</body> 
</html>

Submit "Expressions in JSP" to Facebook Submit "Expressions in JSP" to Digg Submit "Expressions in JSP" to del.icio.us Submit "Expressions in JSP" to StumbleUpon Submit "Expressions in JSP" to Google

Categories
Tutorial

Comments