Welcome to Dream.In.Code
Become a Java Expert!

Join 150,197 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,022 people online right now. Registration is fast and FREE... Join Now!




understanding MVC model

 
Reply to this topicStart new topic

understanding MVC model, how to use servlets,javabean and jsp page together

cybernaut09
12 Sep, 2008 - 10:21 AM
Post #1

New D.I.C Head
*

Joined: 1 Jun, 2008
Posts: 20


My Contributions
I know why we need to use MVC model in our web application but there are some points which I am not able to get . I know in MVC model we use javabean as Model,jsp page as View,servlet as controller but how to arrange them in link.

As an example for my problem lets take a simple login page . For view , a jsp page contains 2 textfields and a submit button .Now when user enters his username and pasword ,the data should be passed to the controller i.e a servlet.

Now the problem I have are :

1 . for the validation , we pass the data as arguments from controller to a javabean we have created as Model . Now should we pass the result back to the controller or directly to the jsp page through javabean . I mean, should it be like every reponse/request should first be passed to the controller and then controller should handle them .I am confused .

2. In what cases ,for example, we should let javabean commmunicate directly with jsp page as shown in the diagram here http://en.wikipedia.org/wiki/Model-view-controller . Because doing so will leave no role of a controller which should be used in MVC model .

May be my problem is that I am not able to clearly understand the relationship between Model-View-Controller . So please help .

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 04:46AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month