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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]