JSP-Expression tag

 

Expression tag is used to display output of any data on the generated page. The data placed in Expression tag prints on the output stream and automatically converts  data into string. The Expression tag can contain any Java expression used for printing output equivalent to out.println().Thus, an expression tag contains a scripting language expression which is evaluated, automatically converts data to a String and the outputs are displayed.

Notation of Expression tag is shown below:

<%= %>

Expression tag must begin with <%= Inside Expression tag, the user embeds any Java expression. Expression tag ends with the notation %>.

syntax of Expression Tag:

<%!                  //start of declaration tag

statement
       //Java Expression

%>
                   //end of declaration tag

          Example:

<%!

Exfdate: <%= new java.util.Date() %>

%>

Leave a Reply

Your email address will not be published. Required fields are marked *