Home
Core Java
Servlet
JSP
Struts2
Mail API
Hibernate
Spring
Android
Quiz
Projects
Interview Q
Comment
Forum
Basics of Struts2 Struts Model1 vs Model2 Struts2 Features Steps to create Struts2 application Struts2 in Myeclipse Core Components Interceptors ValueStack ActionContext ActionInvocation OGNL Struts 2 Flow Struts2 Action Struts2 Configuration multi configuration multi namespace Interceptors params interceptor intermediate result preparation logic ModelDriven Exception Handling Custom Interceptor Struts 2 Validation Custom Validation Input Validation Ajax Validation Aware Interfaces ServletActionContext SessionAware ServletContextAware Struts2 with I18N Zero Configuration By convention By annotation Struts2 with Tiles2 Hibernate with Struts2 Spring with Struts2 Development Registration Example Login and Logout Fetch All Records
<<prev
next>>
Model 1 and Model 2 (MVC) Architecture Model 1 Architecture Model 2 (MVC) Architecture
Model 1 Architecture
Servlet and JSP are the main technologies to develop the web applications. Servlet was considered superior to CGI. Servlet technology doesn't create process, rather it creates thread to handle request. The advantage of creating thread over process is that it doesn't allocate separate memory area. Thus many subsequent requests can be easily handled by servlet. Problem in Servlet technology Servlet needs to recompile if any designing code is modified. It doen't provide separation of concern. Presentation and Business logic are mixed up. JSP overcomes almost all the problems of Servlet. It provides better separation of concern, now presentation and business logic can be easily separated. You don't need to redeploy the application if JSP page is modified. JSP provides support to develop web application using JavaBean, custom tags and JSTL so that we can put the business logic separate from our JSP that will be easier to test and debug.
As you can see in the above figure, there is picturized the flow of the model1 architecture. 1. Browser sends request for the JSP page 2. JSP accesses Java Bean and invokes business logic 3. Java Bean connects to the database and get/save data 4. Response is sent to the browser which is generated by JSP
www.javatpoint.com/model-1-and-model-2-mvc-architecture
1/3
4/22/13
Controller The controller module acts as an interface between view and model. It intercepts all the requests i.e. receives input and commands to Model / View to change accordingly.
<<prev
next>>
544
36
6
Google +
Tw eet
71
Like
7.5k
javatpoint.com
Like 7,526 people like javatpoint.com.
www.javatpoint.com/model-1-and-model-2-mvc-architecture
2/3
4/22/13
Like the www.javatpoint.com on facebook / google+ / twitter / subscribe to get latest updates
Sitemap javatpoint.com is developed Core Java Servlet JSP Struts2 Hibernate Spring Android Interview Questions
to provide easy and point to point learning and training in detail. Examples might be simplified to improve reading and basic understanding. Tutorials and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. If there is any mistake, please mail to sonoojaiswal1987@gmail.com or sonoojaiswal@javatpoint.com. We provide assurance of 90% interview questions. While using this site, you agree to have read and accepted our terms of use and privacy policy. Copyright 2011-2012. All Rights Reserved.
www.javatpoint.com/model-1-and-model-2-mvc-architecture
3/3