Servlet object

Hi all,I want to know a simple question as servlet container automatically create object of any servlet when it load a servlet. But my question is can we create a servet object by our own.Please help me regarding this with an examle
[253 byte] By [umesh_awasthia] at [2007-11-27 0:00:52]
# 1
Why would you want to instantiate a servlet yourself? I think you are attempting to do this for the wrong reasons.
MichaelW13a at 2007-7-11 15:51:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi Micheal!i just wana to know is it possible or not as if it is please can u explain me with example.Thanks,Umesh
umesh_awasthia at 2007-7-11 15:51:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

You can.

Servlet servlet = new Servlet();

And now?

Face it, the created servlet is fairly useless. A serlet is created and invoked automatically when you calls it by a URL which matches the url-pattern of the servlet as definied in the web.xml.

What is your goal? What do you want to achieve? Maybe there are cleaner ways.

BalusCa at 2007-7-11 15:51:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
> And now?Exactly. Your servlet will never be invoked. Without a container, a servlet is only a servlet in name. Calls to methods such as getServletConfig, getServletContext, getServletInfo, getServletName and log will not work correctly.
MichaelW13a at 2007-7-11 15:51:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...