title: Java Web Application Structure
body: <p>I'm looking to implement a simple web-based application. The main reason I want to do it is to learn a bit about Java EE technologies, but I want to make sure that the approach I'm taking is sane.</p>
  
  <p>The application should allow someone to upload a file (initially an image, but will be video eventually). I will do some analysis on the uploaded file, and then present the results back to the user, as well as storing the results in a database.</p>
  
  <p>So, what I'm thinking of is:</p>
  
  <ol>
  <li>Write the (very simple) web-page
  using JSP, </li>
  <li>Have a servlet that
  reads the uploaded image and stores
  it on the server</li>
  <li>Have the
  servlet call an EJB that does the
  grunt work (analyses the image and
  saves the results in a database)</li>
  <li>After the EJB has done the analysis,
  it returns the results to the
  Servlet for presentation.</li>
  </ol>
  
  <p>Does this sound reasonable, or am I way off??</p>
  
  <p>Also, any particular technologies (spring?, a persistence lib?) people would recommend to implement it?</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>Found this great reference that seems to give a good step-by-step guide for what I want to do <a href="http://static.springframework.org/docs/Spring-MVC-step-by-step/" rel="nofollow noreferrer">here</a>. Thought it may be of use for people interested in this question.</p>