Reputation: 1779
I try to find that in JSP people use several different tags like <% %>
and<%! %>
when add Java code to page, but can anyone tell me what is the main difference between this two tags.
Thanks.
Upvotes: 3
Views: 941
Reputation: 49
<!% %>
Tag is declare java method(function) in JSP page
<% %>
Tag is write Statement in JSP page
JSP look like a java class
over!
Upvotes: 1
Reputation: 1046
Scriptlets are blocks of code delimited by <% and %>
Declarations are delimited by <%! and %>
you can refer this link it http://inside.mines.edu/~crader/cs443/Chapters/Chap10.html
Upvotes: 0
Reputation: 1047
So, there are a number of different jsp scripting elements, each with different usages. These are:
<% %>
: Scriptlets
<%! %>
: Declarations
<%@ %>
: Directives
<%= %>
: Expressions
<%-- --%>
: Comments
For full documentation, see: http://docs.oracle.com/cd/B14099_19/web.1012/b14014/genlovw.htm
Upvotes: 7