JSP declaration tag is used to declare fields and methods. The code written inside the jsp declaration tag is placed outside the service() method of auto generated servlet. So it doesn't get memory at each request.
The general form JSP declaration tag is:
<%! field or method declaration %>
|JSP Scriptlet Tag||JSP Declaration Tag|
|declare variables not methods.||declare variables as well as methods.|
|placed inside the _jspService() method.||placed outside the _jspService() method.|