jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Difference between Model1 and Model2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Difference between Model1 and Model2 " Watch "Difference between Model1 and Model2 " New topic
Author

Difference between Model1 and Model2

Mothea Anil Kumar
Greenhorn

Joined: Aug 01, 2005
Posts: 22
Hi,

I am new to struts. Plz tell me wht r the main difference between Model1 and Model2( followed by struts) architectures.And also plz tell me wht r the advantages of using struts framework.

Thanks,
Anil
Uma Mahi
Ranch Hand

Joined: Jan 11, 2006
Posts: 34
Hi,MVC is a design pattern. It contains two models. MVC Model1, MVC Model2 .Struts framework implements MVC Design Pattern. Struts can implement Model 1 and Model 2. Model 2 most properly describes the application of MVC in a Web-Application context.Following are the important feature of MVC1 architecture: (1) HTML or JSP files are used to code the presentation. JSP files use java beans to retrieve data if required.(2)MVC1 architecture is page-centric design all the business and processing logic means any JSP page can either present in the JSP or may be called directly from the JSP page.(3)Data access is usually done using Custom tag or through java bean call.Therefore we can say that in MVC1 there is tight coupling between page and model.Following are the important feature of MVC2 architecture(1)This architecture removes the page-centric property of MVC1 architecture by separating Presentation, Control logic and Application state(2)In MVC2 architecture there is one Controller which receive all request for the application and is responsible for taking appropriate action in response to each request. Second one is Model which is represented by JavaBeans, business object, and database. Third one is View or is JSP page it takes the information provided by Controller and Module and presents it to user


Umaa Mahi<br />--SCJP1.4
Mothea Anil Kumar
Greenhorn

Joined: Aug 01, 2005
Posts: 22
Thanks for ur replay. Now i know the difference between Model1 and Model2.
But i have another doubt is tht,
Why servlets are used as a controller in Struts framework ?
Why JSP's are not used ?
Plz give ur response.

Thanks,
Anil
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Your question is very broad and could take up several chapters in a book. I would recommend "Art of Java Web Development" by Neal Ford.

- Brent
Sankar Reddy Telukutla
Greenhorn

Joined: Jan 11, 2006
Posts: 1
we can write code using jsp very efficiently for presentation.

1 .suppose changes are made in the presentation...
for that we need to open the appropriate servlet and after modified we need to compile that.after successfully compiled we need to launch the server again. that is redeploy.

send reply fo more......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between Model1 and Model2