Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Static

 
leela mohan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please explain in detail.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic