Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


deek

4 posts

Wannabe Geek
Inactive user


#16722 24-Oct-2007 20:04
Send private message

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




Create new topic
frio
80 posts

Master Geek


  #95207 14-Nov-2007 19:23
Send private message

Heya Derek,
MVC is quite hard to follow in JSP pages - while Sun recommends it (and it is best programming practise), JSP pages and servlets can be quite hard to mold into an MVC framework.

I'd say the best option if you do strictly want to follow MVC methodologies would be a), but we all have to make sacrifices sadly... and in the interests of performance, I'd say the best overall option would be to violate MVC and just chuck the code in the view.

Good luck :).



deek

4 posts

Wannabe Geek
Inactive user


#95393 15-Nov-2007 19:08
Send private message




Thanks a lot  for your reply , Simon .Smile

Iam following point (a) only , by the way .










Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.