File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Need some help regarding MVC arcitecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Need some help regarding MVC arcitecture" Watch "Need some help regarding MVC arcitecture" New topic
Author

Need some help regarding MVC arcitecture

chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Hi everybody, I am chaitanya, I was going through Head first servlets and jsps, while going through MVC architecture I got a doubt how to implement it with this requirement.

I have a user details form which will take the user details along with his image, and submits it to the server.

My idea is, there is a jsp which will take the user details, submits it to a controller, then the controller will submit the user details to a model. the model will take care of rest of creating a record on the particular user. The image is not inserted in the database, it is stored in the server itself. Now should I write the code for reading the image in the controller or should I forward the request to another model and get it done.

Is my idea a correct one. if not Please suggest me some ideas.

Thank you in advance.


Love all, trust a few, do wrong to none.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

My idea is, there is a jsp which will take the user details, submits it to a controller

That's backwards. You should submit to a controller. JSPs are for view, not processing.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

Bear Bibeault wrote:
My idea is, there is a jsp which will take the user details, submits it to a controller

That's backwards. You should submit to a controller. JSPs are for view, not processing.


Hi Bear, the jsp page which consists the user form will submit the user details to a controller, then the controller submits the details to a model.

My doubt is should the image be handled in the controller or the model to which the user details were forwarded should handle the image.

Thank you in advance.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Need some help regarding MVC arcitecture
 
Similar Threads
JSF 2.0 Dependency injection problem
MVC for click and drag interface with multiple models
am I using MVC correctly?
MVC and my design
Your opinion on MVC please.