Struts 2, Introduction To Struts Framework
Let us see the quick and brief introduction to struts 2 framework, struts is an open source framework given by Apache software foundation under one of its projects called Jakarta. Struts are the framework, used to develop web applications for java with mvc2 architecture.
Let us see the quick and brief introduction to struts 2 framework, struts is an open source framework given by Apache software foundation under one of its projects called Jakarta. Struts are the framework, used to develop web applications for java with mvc2 architecture.
Actually struts 1 was introduced in 2004 and this framework is failed to satisfy the needs of customers in today’s worlds, finally, Apache joined with OpenSymphony and created struts2.x.
struts 2 = webwork2 + struts 1
webwork2 is the framework from OpenSymphony, java based mvc2.
You know what struts 2 is not an extension of struts 1, it's the combination of struts 1 and webwork2 some features taken from struts1 and some from webwork2 and finally released this struts2 framework.
Types of frameworks
Frameworks are divided into 2 types,
- Invasive
- Non-Invasive
Invasive means, it will force the programmers to create their classes by extending or implementing from per-defined classes or interfaces provided by that framework. Non-Invasive means it won't forces the programmer to extend or implement its own classes or interfaces.
Struts are the type of Invasive framework.
Why struts so popular
- Struts supports extensive validations where other frameworks doesn’t
- Having inbuilt support for I18N
- Struts 2 actions classes are spring friendly so we can easily integrate
- In build, AJAX themes to make the applications more dynamic
- Finally, good framework for front end based applications, I will explain this point later haha
Model 1 and Model 2 (MVC) Architecture
Before developing the web applications, we need to have an idea about design models. There are two types of programming models (design models)
- Model 1 Architecture
- Model 2 (MVC) Architecture
Model 1 Architecture
Servlet and JSP are the main technologies to develop the web applications.
The servlet was considered superior to CGI. Servlet technology doesn't create a process, rather it creates a thread to handle the request. The advantage of creating a thread over process is that it doesn't allocate separate memory area. Thus many subsequent requests can be easily handled by the servlet.
The problem in Servlet technology Servlet needs to recompile if any designing code is modified. It doesn'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 the 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.
Comments
Post a Comment