Hi geeks
Iam creating a site for booking movie tickets using J2EE,J2ME and struts.
My question is fundamental. Iam following MVC or Model-View-Controller architecture , where each request from the client goes though a controller Servlet and it's the controller which calls the business logic residing in Model(java classes). The controller in turn sends back the corresponding view (presentation) using jsp pages.
I have stored images ,corresponding to each movie, in a MySQL database.
Usually, when a client request comes for any specific information, i extract the data from database and store it in session in a way which can be extracted back in the JSP pages to be viewed by clients.
In this case, when a user request comes, for showing movie details, I extract images from MySQL database as usual.
But my doubt is
a) should i put the images (which are big) into session and open those images on client side,from session, in JSP?
b) Or should i write the image extraction logic in the JSP page itself?
If I follow point (b) , i will be breaking the MVC architecture, since all business logic (including extraction from database)are supposd to be done in Model and not in the View.
If I follow point (a), my Session object size increases.
The only option will be to put the images statically on the JSP/HTML pages.
I hope iam clear to all u geeks out there.
Any suggestions will be very helpful.
Thanks
Deepak