Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Static" Watch "Static" New topic


leela mohan

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

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
Don't get me started about those stupid light bulbs.
subject: Static