Explain JSP declaration and scriptlet tags?

Answered

Explain JSP declaration and scriptlet tags?

Ninja Asked on 18th September 2018 in Jsp.
Add Comment
1 Answer(s)
Best answer

<%! … %> are JSP Declaration tags while <% … %> are JSP Scriptlet tags.

In JSP declarations – <%! code %>, the code is inserted into the body (outside of the methods) of the servlet class generated from the JSP page.

In Scriptlet – <% code %>, the code goes into the _jspService() method of the servlet generated from the JSP page. The code is visible only to the _jspService() method of the servlet class.

Ninja Answered on 18th September 2018.
Add Comment