Sunday, March 26, 2006

Minimal Servlet Container

Recently I wrote a demo java program which controls USB devices present in a system, by accepting options as command-line arguments (i.e. runs only in command prompt). I thought of writing a GUI, so the user can easily control it. The immediate option came to my mind, is to use a java swing client. But I am not really comfortable in swing/awt; also I had only limited time to finish it. I don’t want to spend time in aligning fields in UI, rather I thought of developing web-based interface, which I am most comfortable with. 

Okay, but now I have to deploy my war file in the client place to show a demo!

Will they have a tomcat installed in there machine?  How much instructions I have to provide them, so they can self-deploy the application? What I they have problem in deploying?



 I thought of going for an minimal webcontainer, to deploy my war file, so they don’t need any special web containers, such as tomcat. 

When I looked for such containers, I had two constraints; smaller size and easier to start. Also, my application used only servlets and plain HTML, So its enough for me to get an embedded container which supports only these minimal requirements, so I can get smallest sized container. 

Jetty, Miniature JWS, Winstone are some of the options I got after doing a Google. I decide to go with winstone because; it supported my requirements with just 160K (only servlet2.4, no JSPs). Jetty is of huge size when compared to other. But if you are looking for more features, or have a plan to support more features later on, then jetty would be best (which is not certainly my requirement).Though Miniature JWS claimed to be of smaller size than winstone, I couldn't easily figure out, how to deploy a war file. 

In winstone, its 

>java -jar winstone.jar sampleApp.war 

Now, I can access my application thru, http://localhost:8080/  

Winstone, with easy start-up options, also of smaller size (160KB), served my needs! 

No comments:

Recommended Blog Posts