Tomcat and Servlets

Bryan Sant bryan.sant at
Sat Mar 18 18:38:32 MST 2006

On 3/17/06, Ross Werner <ross at> wrote:
> With Tomcat, if you just drop a *.jsp file into webapps/ROOT and point
> your web browser to http://localhost:8080/foo.jsp, Tomcat automatically
> compiles the jsp file and does all the magic needed to run it and return
> the output.
> With other web servers (like NetForge, for example) you can do the same
> thing with servlets--with NetForge, simply compile a *.class and drop it
> into servlet/ and if you point your browser to http://localhost:8080/Foo,
> it will run servlet/Foo.class.
> Is there a way to do this with Tomcat without having to monkey around in
> XML files for every servlet class? i.e. some configuration option that
> will make every *.class file in a particular directory map to its class
> name?
> Thanks (hope this makes sense),
>         ~ Ross

A simple filter could be written to do what you want.  I'll submit one
if you really need it -- I'm sure there is a few written out there
that do just that anyway.  However, what you're wanting is a model 1
type web application.  Most Java web frameworks are model 2.  So you
would only have one dispatch servlet configured in web.xml and all
other servlets or jsps would be invoked by that main contoller


More information about the PLUG mailing list