The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by paul wheaton:
I guess I thought there would be a web page spelling this sort of thing out.
Originally posted by Ulf Dittmer:
why not use Tomcat as the embedded server?
If you want to have just one jar, you might want to take a look at http://one-jar.sourceforge.net (haven't ever used it myself, though).
I guess you have already found http://docs.codehaus.org/display/JETTY/Embedding+Jetty which explains how to, well, embed jetty.
For your html files, you need to add a ResourceHandler to your context: http://www.mortbay.org/apidocs/org/mortbay/jetty/handler/ResourceHandler.html - the resourceBase you have to configure is the root folder for your static content (that is, html files, images, etc. pp.) I don't see a handler that would be able to serve the static content directly from the jar file, but I guess it wouldn't be too hard to write your own.
Does that help?
why not use Tomcat as the embedded server?
Originally posted by paul wheaton:
My math says that jetty would be 774k. Not so?
I suspect that it would be bigger if you are using JSP or some of the other stuff. My servlets are pretty standard and everything else is just served up as static files.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |