Hi Everyone! I'm a newbie with
JSP and I've tried a jsp example from the book "Mastering Jakarta Struts." I typed the code exactly as written in the book but i can't seem to make it work. Everytime i press the refresh button the count does not increment - which is what it is supposed to do. Below is the code for the jsp:
<html>
<head>
<title>Session Example</title>
</head>
<body>
<%
Integer count = (Integer)session.getAttribute("COUNT");
if(count==null) {
count=new Integer(1);
session.setAttribute("COUNT", new Integer(1));
}
else {
count=new Integer(count.intValue() + 1);
session.setAttribute("COUNT", count);
}
out.println("<b>You have accessed this page: " + count + " times</b>");
%>
</body>
</html>
I'm using
tomcat 5.5 by the way. I hope someone can help me out with this. Thank you.