Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP declaration

 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can some JSP gurus help me understand why the following JSP increment by 3 every time we reload?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>JSP Declaration</TITLE>
<META NAME="Generator" CONTENT="TextPad 4.0">
<META NAME="Author" CONTENT="Jason">
<META NAME="Keywords" CONTENT="JSP, Java, Server Pages, servlets">
<META NAME="Description" CONTENT="A simple example that describes how declartion works in JSP">
<LINK REL=STYLESHEET
HREF="JSP-Style.css"
TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
<H2>JSP Declaration</H2>
<%!private int accessNo;%>
This page has been accessed
<%=accessNo++%> times.
</BODY>
</HTML>

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic