The code placed within JSP expression tag is written to the output stream of the response. So you need not write out.print() to write data. It is mainly used to print the values of variable or method.
Synatx :
Synatx :
<%= statement %>
JSP Expression Tag Example
Example
1: Expression of values
Here
we are simply passing the expression of values inside expression tag.
<html>
<head>
<title>JSP
expression tag example1</title>
</head>
<body>
<%= 2+4*10 %>
</body>
</html>
Example 2: Expression that print user name
In this Example, we are going to print Username using Expression tag
<html>
<body>
<form action="welcome.jsp">
<input type="text" name="uname"><br/>
<input type="submit" value="go">
</form>
</body>
</html>
0 comments:
Post a Comment