Declaration Tag in JSP, What is the use of Declaration tag in JSP, How to Declare the global variable and methods in JSP


Declaration Tag in JSP, What is the use of Declaration tag in JSP, How to Declare variable and functions in JSP

The Declaration tag in JSP is used to to declare the variables and methods in JSP. If you want to declare the global variables in JSP the Declaration tag is used, the variables and methods which are declared into the Declaration tags are available in the entire JSP page and every scriptlets tag which is used into the JSP page.

The syntax for Declaration tag is follows:-

<%!
declare variables...
declare functions...
%>

The following example shows the declaration tag:-

<%!
int x,y,z;
public void sum(int x, int y);
%>

Thanks for visiting

{ 0 comments... read them below or add one }

Post a Comment