By: Sathya Narayana Emailed: 1729 times Printed: 2338 times
The following syntax allows you to declare variables and methods for the page. These are placed in the generated servlet outside the _jspService() method; in other words, variables declared here will be instance variables of the servlet. Declarations don't produce any output.
This is an example of declaring a variable:
The following code declares a variable and initializes it:
You can define a method for use on the global page like so:
Declaration tags are mainly used in conjunction with scriptlets.
Be the first one to add a comment
Most Viewed Articles (in JSP )
Most Emailed Articles (in JSP)