JSP Declaration are tags used in declaring variables. They are enclosed in <%!%> tag. They are used in declaring functions and variables.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<%@pagecontentType=”text/html”%>
<html>
<body>
<%!
inta=0;
privateintgetCount(){
a++;
returna;
}
%>
<p>Values of a are:</p>
<p><%=getCount()%></p>
</body>
</html>
|