Servlet Question [message #153815] |
Tue, 23 May 2006 13:23 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.08768 seconds