The XMP syntax for declaration is <jsp:declaration>…</jsp:declaration>
The example below illustrates a few variants of JSP declarations.
|<%! int i; %>
<%! String str=”hello world”; int y=0; %>
<%! boolean flag=true; %>
<%! Boolean flagClass=new Boolean(true); %>
All examples above declare variables. They do not print any thing on the web page. A scriptlet or an expression can be used to access variables declared in JSP expression.
Similar to variable declaration, method declaration may also be included within JSP declarations.
Ask your questions or clarify your/others doubts from,