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.
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.
So, what I’m thinking of is:
- Write the (very simple) web-page
using JSP, - Have a servlet that
reads the uploaded image and stores
it on the server - Have the
servlet call an EJB that does the
grunt work (analyses the image and
saves the results in a database) - After the EJB has done the analysis,
it returns the results to the
Servlet for presentation.
Does this sound reasonable, or am I way off??
Also, any particular technologies (spring?, a persistence lib?) people would recommend to implement it?
Thanks
Update
Found this great reference that seems to give a good step-by-step guide for what I want to do here. Thought it may be of use for people interested in this question.
IMHO, unless you are locked in to EJBs, I would avoid that whole layer.
Using a framework like Spring or Structs, build the app using a MVC pattern, and have your controller talk to a decoupled service object to do the analysis. The service would return the result back to the controller, the controller could bundle that up into your model object to pass to the view for rendering.