title: Web User Interface for a Java application
body: <p>I'm trying to create a web user interface for a Java application. The user interface is going to be very simple, consisting of a single page with a form for users to pose their queries, and a results page -- sort of like Google's search engine or Ask.com. </p>
  
  <p>I'm quite familiar with the base API of Java, but I don't have much experience in using Java for Web environments (though I've used ASP.NET), so I'm looking for some advice:</p>
  
  <ul>
  <li><p><em>What <strong>web application server</strong> should I use?</em> Note that my interface is very light, and I just want something that is fast, easy to start/reset/stop and (re)deploy my application. Also, I need it to work on <strong>multiple environments</strong>, namely, GNU/Linux, Mac OS X, and Windows XP/Vista. Additionally, I'm using <code>ant</code> and <code>Eclipse</code>, so it would be great if I could easily add some <code>ant</code> targets for server management, and/or manage the server using the IDE. I've looked into <strong>Tomcat</strong> and <strong>Jetty</strong>, and the latter seems to be very light and easy to install and deploy. This is ideal, because the GUI is just for demonstration purposes, and I'll probably need to deploy it in different computers. However, Tomcat has been around for a very long time, and it seems more mature.</p></li>
  <li><p>As for the <strong>web pages</strong>, Java Server Pages look like a good fit, as they seem sufficiently simple for what I'm trying to accomplish (processing a form and outputting the result), but I'm all ears for suggestions. </p></li>
  <li>I also have another requirement, which requires me to explain the "basic" workflow of the application: Basically, I have a class <code>Engine</code> which has a method <code>run(String)</code> which will process the user's input and return the results for display. This class is the <em>core</em> of the application. Now, I'd like to <strong>instantiate</strong> this class <strong>only once</strong>, as it requires a <strong>lot</strong> of memory, and takes a very long time to startup, so I'd like to create it when the application/server starts, and store that reference for the entire span of the application (i.e., until I stop the server). Then, for each user request, I'd simply invoke the <code>run</code> method of the <code>Engine</code> instance, and display its results. <em>How can this be accomplished in Java?</em></li>
  </ul>
  
  <hr>