Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I redirect the session acount after the third number

Status
Not open for further replies.

kizzieb

Technical User
Oct 16, 2007
6
GB
<%@ page errorPage="errorpage.jsp" %>

<html>
<head>
<title>UseSession</title>
</head>
<body>
<%
Integer count = (Integer)session.getAttribute("COUNT");
// If COUNT is not found, create it and add it to the session
if ( count == null ) {

count = new Integer(1);
session.setAttribute("COUNT", count);
}
else {
count = new Integer(count.intValue() + 1);
session.setAttribute("COUNT", count);
}
out.println("<b>Hello you have visited this site: "
+ count + " times.</b>");
%>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top