GeeCON Prague 2014*
The moose likes Servlets and the fly likes Static Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Static" Watch "Static" New topic
Author

Static

leela mohan
Greenhorn

Joined: Oct 31, 2006
Posts: 13
it is an one of the FAQ
servlet is not having main method so static method can call by object of class,directly, or classname
but to call this also i thing we need mainmethod so reply please
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Could you please explain in detail.


Rahul Bhattacharjee
LinkedIn - Blog
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The main method in a Java class is not for other Java components.
It's for calling a Java program from the command line.

Servlets are not called from the command line. they are invoked by the container in response to an HTTP request.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
GeeCON Prague 2014
 
subject: Static