Hi,
You use a text file to store the counter data.
Regards
Deepak Kumar
http://www.geocities.com/Deepak_38
--- Kalman Hazins <[EMAIL PROTECTED]> wrote:
> Hi, all. I have a small problem.
>
> I got some free webspace at www.mycgiserver.com and
> tried practicing writing
> a JSP counter.
>
> This was my code:
>
> <% out.println("This page has been accessed ") ; %>
> <%! int times = 0; %>
> <% out.println(times++ + " times") ; %>
>
> So, it basically works. That is when I hit the
> "Refresh" button the # of
> counts goes up. And sometimes even when I close the
> browser window and
> reopen it again --- it shows the right count...
> BUT... every once in a while
> I come back to the page ( a few hours later) and I
> see that a lot of times
> the count starts from 0 again. What can the problem
> be ???
>
> --- Kalman
>
> P.S. The page I created was
> www.mycgiserver.com/~Kalman
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body:
> "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets