views:

432

answers:

4

I have an old legacy java web application that I want to deploy on the same server as my asp.net-applications (running on IIS 7). And I need to have all applications running on port 80, so I can't just install two web servers on different ports.

The java-application is really simple, just a couple of serverlets (no JSP) with functionality pretty close to "Hello World". So I want the servlet engine to be as lightweight as possible. I consider Tomcat to be overkill for this.

Does such a product exist or I'm I stuck with Tomcat?

+7  A: 

Have a look at Jetty. It can be invoked from a standard Main invocation, and handles servlet containers pretty well (GWT debugging is hosted in a Jetty environment, for example).

I've used this for debugging Lift applications, and been pretty impressed.

To forward requests through IIS to Jetty you can try mod_jk. The problem is that IIS and Java/JSP don't Just Work because IIS needs add-ons to support the loading of the VM and the reflection of JSP/Java content. There is an excellent article on how this can be done here.

butterchicken
Thanks for your quick answer!Yes, Jetty is nice product. I use it locally when developing java applications as well. But how well does it integrate with IIS? Is it the same procedures as with Tomcat? Or is it, as I suspect, much worse? Have you or anyone else tested it with good results? (Is it even possible to get good results in a setup like this?)
Ola Herrdahl
+1  A: 

I'm sure you don't want to get too exotic but if you don't find something to your liking, you could always run Tomcat on a different port and then do some reverse proxying and send everything heading to a specific context to your Tomcat install running on port XYZ, although admittedly I'm only familiar with this in the Apache world, and not the IIS world.

MattC
+1  A: 

Check out JK, it has an Apache module and I think it also has an IIS module to connect with Tomcat (maybe Jetty, I don't know). This will allow you to run your app on Tomcat on some other port (even on some other host) and access it through your IIS.

http://tomcat.apache.org/connectors-doc/

Chochos
+1  A: 

If you use Java 6, there is a HTTP server built-in,

http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html

Of course, this wouldn't be a good solution if you care about portability.

ZZ Coder