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.
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
<!% %> Tag is declare java method(function) in JSP page
<% %> Tag is write Statement in JSP page
JSP look like a java class
over!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With