/* Copyright (c) SEMM NL All rights reserved.
Author : Paul Hamaker. Part of JavaLessons.com
This code is for educational purposes only. Use at own risk.*/

1. <%! 

2.   int h = 0

3. %> 

4.  

5. <%! 

6.   int matthud() 

7.   { 

8.     ++h ; 

9.     return h ; 

10.   } 

11. %> 

12.  

13. <HTML

14. <HEAD

15. <TITLE

16. JSP Declaration 

17. </TITLE

18. </HEAD

19.  

20. <BODY

21.  

22. <h1

23. This page's hit counter now : 

24. <%= matthud() %> . 

25. </h1

26.  

27. </BODY></HTML

28. <%-- 

29. ======== Generated servlet source code =============================== 

30. .... 

31. public class _0002...declaration_jsp_2 

32.     extends HttpJspBase

33.  

34.      int h = 0

35.  

36.      int matthud() 

37.      { 

38.         ++h ; 

39.         return h ; 

40.      } 

41. .......... 

42.     public void _jspService ( HttpServletRequest request, HttpServletResponse  response) 

43.       ........ 

44.       out.print( matthud() ); 

45. .......... 

46.  

47. --%>