dcsimg
<strong>Servlet Page not load!</strong>
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   liulie_lai
Posted On:   Tuesday, May 14, 2002 09:00 AM

Hi, I am using Tomcat 4.03 with J2SE 1.4 on Windows 2000 environment. I had write a simple LOGIN and LOGOUT servlet with Database Connection to log the user access in MySQL. I had written a checking statement in the Servlets (i.e. System.out.println("User Login"); in LOGIN servlet and System.out.println("User Logout"); in LOGOUT servlet). The problem is, when I run the LOGIN and LOGOUT servlet at the first time, it shows the checking statement "User Login" & "User Logout" in Tomcat Console respectively. But after I try this action at the second or third time or later, it doesn't show the checking message and I also can't find any logging in the Database too! So, does anyone seen   More>>

Hi, I am using Tomcat 4.03 with J2SE 1.4 on Windows 2000 environment.


I had write a simple LOGIN and LOGOUT servlet with Database Connection to log the user access in MySQL. I had written a checking statement in the Servlets (i.e. System.out.println("User Login"); in LOGIN servlet and System.out.println("User Logout"); in LOGOUT servlet).

The problem is, when I run the LOGIN and LOGOUT servlet at the first time, it shows the checking statement "User Login" & "User Logout" in Tomcat Console respectively. But after I try this action at the second or third time or later, it doesn't show the checking message and I also can't find any logging in the Database too!

So, does anyone seen this problem before?? or there is some caches setting in Tomcat 4.03? Please help! Many thanks!


(Remarks of page flow : Login JSP -> LOGIN servlet -> Main JSP -> LOGOUT servlets -> Login JSP)

   <<Less

Re: <strong>Servlet Page not load!</strong>

Posted By:   gayathri_meenakshi  
Posted On:   Wednesday, May 15, 2002 09:58 PM

Hi,

I think that you have issued the System.out.printlns..

in the init method of the servlet.

Try putting them in the service , dopost()or doget() methods and it would work.

The init() method gets invoked only when the servlet gets invoked for the first time.

On subsequent invocations the init method dosent get invoked.

Hope this helps,

Cheers,
Gaya.
About | Sitemap | Contact