Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a web server / servlet container in Java - Standing on the shoulders of giants

First and foremost: I want to state that this is mostly a personal exercise. There are plenty of containers and servers out there (Tomcat, Jetty, Winstone) that satisfy the needs of the market.

The other day I came across the Akka project and, having had a lot of fun with Erlang in the past, decided that it would be really cool to use it to build a functional web server.

Then I started daydreaming. What if I could use modern frameworks and build, in a code golf way, a web server that almost completely "stood on the shoulders of giants"? That is to say: how much of other people's work could I manage to use.

Ideally the requirements would resemble something like:

  • Fault tolerant, clusterable, distributed
  • Easy to configure
  • Supports HTTP, HTTPS, and AJP on configurable ports
  • Supports interface binding and multiple domains
  • Supports JSP, Jython, etc. through a pluggable interface
  • Supports modules that allow implementation of things like WebDAV, proxy, and URL rewrite

My biggest stumbling block at this juncture is how on earth do you use Jasper, Jetty, GlassFish or anything to interpret JSPs without worrying about all the other stuff, like networking, that they bring?

Any other suggestions for features would be highly awesome. I'm also investigating non-traditional configuration methods to see if there's anything out there that I like more than XML or properties files. For those of you who are familiar with Apache, sometimes you need a little scripting and sometimes you just need key/value pairs.

So, in any case, hit me up with your suggestions.

like image 840
Chris Ruffalo Avatar asked Nov 14 '22 01:11

Chris Ruffalo


1 Answers

At least Tomcat has implemented its JSP engine as a module. It's not released separately and it might require some work to fully dis-couple it from the rest of the Tomcat code.

It's got a separate name (Jasper) and its own Howto. It's found in the org.apache.jasper package (and below).

like image 115
Joachim Sauer Avatar answered Dec 06 '22 03:12

Joachim Sauer