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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "not main() in servlet" Watch "not main() in servlet" New topic
Author

not main() in servlet

bakiyalakshmi dhanraj
Greenhorn

Joined: Nov 02, 2007
Posts: 24
Why main() is not written in servlets programs
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

It is all about 'entry points'

When you call a class from the command line, the entry point into your class is the main method.

When you call a Servlet or JSP, the entry point is the service() method, but by default it then calls the doGet or doPost methods for us, so we use these entry points instead.

Applets have a different entry point, they don't have a main() method either.

EJBs are different again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not main() in servlet
 
Similar Threads
packaging runme.jar
First GUI program
java.lang.NoSuchMethodError
WA #1.....word association
run time error