posted 13 years ago
Servlet can be invoked using HTTPRequest and HTTPResponse objects. As Devaka mentioned, this is the only way to call Servlet.
If you want Container to run your servlet at start up of application, try exploring <load-on-startup> element of web.xml. With this, you can load servlet at the start of application.
Please let us know the purpose with which you want to call Servlet dynamically on start up of applcation (Not running that servlet).
Do you want to setup some variable, call some generic method to iniatilize DB connection etc?
Please tell us your reason. We may find some other way to achieve your requirement.
~ abhay
Oracle certified JPA Developer (1Z0-898),Oracle certified Java 8 Programmer I (1Z0-808), Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I, CIW Certified Ecommerce specialist