Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Servlet Question
Servlet Question [message #153815] Tue, 23 May 2006 13:23 Go to next message
Eclipse UserFriend
Originally posted by: tgraham42.nc.rr.com

I noticed on the Snoop servlet tutorial on eclipse.org there is no main()
method for the one class that is created. In the servlet code, the Snoop
class extends javax.servlet.http.HttpServlet and it just returns some
browser information back to a jsp page. I got the code working and I think
understand how it all works. But I was under the assumption though that
you would need a main() method somewhere to make this work. Can anyone
explain why this is not the case?

Thank you
Re: Servlet Question [message #153839 is a reply to message #153815] Tue, 23 May 2006 22:10 Go to previous message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Tom G" <tgraham42@nc.rr.com> wrote in message
news:e67f70ee30430fa49b1d015ee559cc95$1@www.eclipse.org...
>I noticed on the Snoop servlet tutorial on eclipse.org there is no main()
>method for the one class that is created. In the servlet code, the Snoop
>class extends javax.servlet.http.HttpServlet and it just returns some
>browser information back to a jsp page. I got the code working and I think
>understand how it all works. But I was under the assumption though that you
>would need a main() method somewhere to make this work. Can anyone explain
>why this is not the case?

main() is an entry point from the command line. In this case, the servlet
container (eg Tomcat) has a main() method.

It is possible to have main() methods in more than one class - this is
commonly done to permit testing individual classes by running them from the
command line, or to provide multiple runtime configurations.

Was that the question? Sorry if I misunderstood.
Previous Topic:import syntax for newbie
Next Topic:CTRL keyboard
Goto Forum:
  


Current Time: Fri Apr 26 19:46:18 GMT 2024

Powered by FUDForum. Page generated in 0.08768 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top