Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
10.4 JSP Declarations
243
Listing 10.3 shows the full JSP page; Figure 10 5 shows a representative
result.
Listing 10.3 AccessCounts.jsp
JSP Declarations
CONTENT="JSP,declarations,JavaServer,Pages,servlets">
CONTENT="A quick example of JSP declarations.">
HREF="JSP Styles.css"
TYPE="text/css">
JSP Declarations
<%! private int accessCount = 0; %>
Accesses to page since server reboot:
<%= ++accessCount %>
Figure 10 5 Visiting AccessCounts.jsp after it has been requested 15 times by
the same or different clients.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved