This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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