Wednesday, 21 February 2018

JSP Expression Tag – JSP Tutorial

JSP Expression Tag,Synatx JSP Expression Tag,JSP Expression Tag Example,

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 : 
                       <%=  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>






DashZin

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment