Expression Tag

An expression is notation for a scriptlet that sends the value of a java expression back to the client. The expression is evaluated at HTTP request processing time, and result is converted into string and displayed.
In jsp page when we write data then we use out.print(), but in case of expression tag, there is no any requirement out.print method to write data.
Syntax of Expression tag
<%= java expression % >
Note : When we are using expression element tag statement, semicolon does not used as line terminator.
Expression tag Example as Display message
<html> <head> <title>Welcome to Expression tag example </title> </head> <body> <%= "Welcome Expression tag Example" %> </body> </html>

Download this example
Expression tag Example as Display variable value
<html> <head> <title>Welcome to Expression tag example </title> </head> <body> <% String name = ""; %> <%= "Welcome "+name %> </body> </html>
Download this example



Latest Tutorial

Most Visited Tutorial