tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Knowles <r...@knowleses.org>
Subject Re: Embedded Tomcat
Date Fri, 30 Sep 2005 17:56:31 GMT
Eric Holk wrote:

>I'm working on a project where I would like to run a simple web front end
>for it. To save the time of implementing my own HTTP server I'd like to
>embed Tomcat. I've read several documents on how to do this, and I've
>managed to get Tomcat running inside my program. However, all the examples
>I've seen show how to load a WAR file and use that as a web application. If
>it's possible, I'd rather just have a sevlet class inside my program that
>Tomcat uses rather than having an external web application.
>
You should be able to get away with just a single external file: a
web.xml file that mounts the servlet and maps it to a URI pattern. The
rest of the webapp code (ie the servlet class you mentioned) would be
able to be inside the main jar, because class loader inheritance would
cause the servlet class to be visible even if it's not in the
WEB-INF/classes folder.

If one external file is too many, you might need to do something tricky
to set the webapp's mounted instances from code. Maybe via JMX ? Someone
else might be able to help here ....

Rick

--
Servlet v2.4 container in a single 155KB jar file ? Try Winstone (http://winstone.sourceforge.net/)



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message