Expression is a type of JSP element which is used to embed Java code in JSP. Container takes the argument of expression (everything written between <%= %>) and put it in as the argument to PrintWriter out which will print on JSP.
<%= scripting-expression %>
Note* : Semicolon inside expression is not allowed.
<%= new java.util.Date() %>
Will be converted to
Above expression can be added to any of JSP. These expressions will be evaluated at run time.
- Semicolon is not required while providing statement in Expression. <%= method(); %> is incorrect
- Method passed to Expression must return something(Not Void return type) else it will throw an error.