hello friends, I have written a servlet class which i will execute by putting the class file in WEB-INF/classes/com.(here com is the package where the servlet exists). Then I mention the proper descriptor in the deployment descriptor. After that I execute the servlet from the web browser. This is the normal way of executing the servlet. But is there any other way of executing the servlet. Thanks in advance. shekar.
Well, you can execute a servlet in any compatible servlet container. For testing purposes some people use a "mock" servlet container which can exercise the servlet under control of a local program, with no HTTP involved. Can you explain a bit more about what you want to do, and why it would be useful to you?
Servlets are designed to operate inside a "servlet container" which provides a number of functions such as creating request and response objects, maintaining a servlet context, etc... Therefore if you want to completely exercise a servlet with realistic request and response it has to be in some sort of a servlet container. For complete realism, it should provide the complete servlet API. If your servlet has a whole bunch of methods that you need to debug, maybe you should rethink your architecture and move those methods into "helper classes" where they can be debugged outside the servlet environment. (Yes, I know, I say that alot ) Bill