aspose 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
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: 806

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: 61612
    
  67

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: 806

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need some help regarding MVC arcitecture