How to run simple servlet under 3.4?
I have servlet that I want to run from within the IDE. What is
the easiest/fastest way of doing this? I don't want to create
a whole "web application", deploying it, etc. Am I supposed to
use the internal "HTTP Server" or the Tomcat 4.0 server that came
pre-installed? I couldn't figure out how to configure either
from within the IDE to let me access/run the servlet.
The documentation at netbeans.org talks about having to have
a particular directory structure (e.g. WEB-INF/classes) and
manually creating/editing web.xml files - I was hoping that I
could simply point to the servlet class file and set some
properties via the Explorer and be done with it. Am I wrong?
Many thanks,
Tom
# 1
Hi,
> I have servlet that I want to run from within the IDE. What is
> the easiest/fastest way of doing this? I don't want to create
> a whole "web application", deploying it, etc. Am I supposed to
> use the internal "HTTP Server" or the Tomcat 4.0 server that came
> pre-installed? I couldn't figure out how to configure either
> from within the IDE to let me access/run the servlet.
>
> The documentation at netbeans.org talks about having to have
> a particular directory structure (e.g. WEB-INF/classes) and
> manually creating/editing web.xml files - I was hoping that I
> could simply point to the servlet class file and set some
> properties via the Explorer and be done with it. Am I wrong?
I think that this is not a "limitation" of NetBeans - the spec for
servlets wants to have this structure. To automate such tasks you should
look at Ant with XDoclet.
Greetings,
Thorsten
# 2
Thomas Wolf wrote:
>
> I have servlet that I want to run from within the IDE. What is
> the easiest/fastest way of doing this? I don't want to create
> a whole "web application", deploying it, etc. Am I supposed to
> use the internal "HTTP Server" or the Tomcat 4.0 server that came
> pre-installed? I couldn't figure out how to configure either
> from within the IDE to let me access/run the servlet.
>
> The documentation at netbeans.org talks about having to have
> a particular directory structure (e.g. WEB-INF/classes) and
> manually creating/editing web.xml files - I was hoping that I
> could simply point to the servlet class file and set some
> properties via the Explorer and be done with it. Am I wrong?
>
Yes, you need to have appropriate structure that is defined in Servlet
spec. Using wizard for new web module will help you.
Radim
> Many thanks,
> Tom
>