is there any way to run java class without client invocation in tomcat?
Meir Yan
Ranch Hand
Joined: Apr 27, 2006
Posts: 597
posted
0
Hello all i wander if there is possibility to invoke java class from tomcat server say for instance when tomcat is done loading he will invoke some kind of class that prints "hello ..." to the prompt , whiteout invoking it from the client side (like jsp page calling java class ). thanks
I suppose (but have never tried it) you could set up a servlet to load at server startup and have that servlet spawn a process on the server machine that would pop up a window on the console to print the message or somesuch... but I'm not quite sure why you'd want to do that in the first place, really.
Is that what you're inquiring about?
Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
Scott Johnson
Ranch Hand
Joined: Aug 24, 2005
Posts: 518
posted
0
Create a class that implements ServletContextListener and configure it in the deployment descriptor.
When you say prompt do you mean the app server log?
Meir Yan
Ranch Hand
Joined: Apr 27, 2006
Posts: 597
posted
0
hello and thanks for the fast reply yeah i mean to the server log or othere log , i like to invoke thread deamon when the server starting so you say servelet?