File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes main() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "main()" Watch "main()" New topic


jignesh soni
Ranch Hand

Joined: Dec 10, 2007
Posts: 150
Why does servlet not have main method ?
Marco Ehrentreich
best scout

Joined: Mar 07, 2007
Posts: 1294

The question is "why should a servlet have a main() method?"

A servlet is usually managed by a servlet container and it's not a standalone application. So there's no reason for it to have a main() method.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63552

Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Please go back and change your post to add a more meaningful subject by clicking the .

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: main()
It's not a secret anymore!