![]() |
VOOZH | about |
The Declaration Tag in JSP is used to declare variables, methods, and classes in a JSP page. The code written inside this tag is placed outside the _jspService() method by the JSP container, making it available throughout the JSP page.
Syntax:
<%! declaration code %>
Example: JSP Declaration Tag which initializes a string
Output:
Explanation:
Example : JSP Declaration Tag which initializes a method
Output
Explanation: