In JSP Why Expression tag can not take the semicolon at end of statement -


expression element in jsp <%= … %> 1 java expression ex:

 index.jsp  ----------  welcome jsp scripting elements    <%! int num1=10;       int num2=20;       int add;    %>   <% add=num1+num2 %>     addition is<%= add %> <@!-- expression tag --> 

from the java server programming black book:

an expression tag contains scripting language expression evaluated, converted string, , inserted expression appears in jsp file. because the value of expression converted string, can use expression within text in jsp file.

like:

    <%= someexpression %>      <%= (new java.util.date()).tolocalestring() %> 

you cannot use semicolon end expression.

in example code

<%= add %> 

means

out.print(add); 

if have add semicolon before close tag

then invalid

out.print(add;); 

it shows error.

know more jsp scripting tags


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -