Introduction :
The struts 2 framework is mainly used to develop MVC-based web application.
MVC (Model View Controller) : It is a software design pattern for developing web applications.It is made up of the following three parts:
– Model : The lowest level of the pattern which is responsible for maintaining data
-View : This is responsible for displaying all or a portion of the data to the user.
– Controller : Software Code that controls the interactions between the Model and View.
Struts2 Framework :
Struts2 is popular web application framework based on the MVC design pattern. Struts2 is not just the next version of Struts1, java training center bangalore but it is a complete rewrite of the Struts architecture.The struts framework was initially created by Craig McClanahan and donated to Apache Foundation in May, 2000 and Struts 1.0 was released in June 2001.
About Struts :
The current stable release of Struts is Struts in March 2, 2014.The Struts 2 framework is used to develop MVC (Model View Controller) based web applications. Struts 2 is the combination of webwork framework of opensymphony and struts1.
Struts 2 Features Tutorial :
Struts 2 provides many features that were not present in struts1. The features of struts2 framework are as follows:
1. Configurable MVC components
2. POJO based actions
3. AJAX support
4. Integration support java course in bangalore
5. Various Result Types
6. Various Tag support
7. Theme and Template support
Struts Components :
[i] The Controller
Controller receives all incoming requests. Its primary function is the mapping of a request to an action class selecting the proper application module. It’s provided by the framework.
[ii] The struts-config.xml File
This file contains all of the routing and configuration information for the Struts application. This XML file needs to be in the WEB-INF directory of the application.
[iii] Action Classes
It’s the developer’s responsibility to create these classes. They act as bridges between user-invoked URIs and business services. Actions process a request and return java /j2ee classes bangalore an ActionForward object that identifies the next component to invoke. They are part of the Controller layer, not the Model layer.
[iv] View Resources
View resources consist of Java Server Pages, HTML pages, JavaScript and Stylesheet files, Resource bundles, JavaBeans, and Struts JSP tags.
[v] ActionForms
These greatly simplify user form validation by capturing user data from the HTTP request. They act as a “firewall” between forms (Web pages) and the application (actions). These components allow the validation of user input before proceeding to an Action. If the input is invalid, a page with an error can be displayed.
[vi] Model Components
The Struts Framework has Advanced java training in bangalore no built-in support for the Model layer. Struts supports any model components:
– JavaBeans
– any other
Difference between struts1 and struts2:
[i] In struts 1.x front controller is ActionServlet. In 2.x front controller is FilterDispatcher
[ii] In struts 1.x we have RequestProcessor class. In 2.x we have Interceptors instead RequestProcessor
[iii]In struts 1.x we have multiple tag libraries like, html, logic, bean..etc . In 2.x we do not have multiple libraries, instead we have single library which includes all tags.
[iv] In struts 1.x the configuration file name can be [any name].xml In 2.x the configuration file must be struts.xml only and this must be in classes folder
[v] In struts 1.x we have form beans and Action classes separately . Best core java training in bangalore In 2.x form bean, Action classes are combindly given as Action class only, of course we can take separately if we want .
[vi] In struts 1.x properties file must be configured in struts-config.xml. But in 2.x we need to configure our resource bundle(s) in file.
[vii] In struts 1.x we have programmatic and declarative validations only. In 2.x we have annotations support too along with programmatic and declarative validations.
This is the short description about the struts framework to know more about the java for getting a job as java developer join Infocampus Software Training Institute for Core and Advanced Java .
Author : Infocampus is best java training center bangalore . It provides java course in lesser fees with the 4 days free demo classes . Advanced java training is provided by the 10+ years experienced trainers . Learn Struts framework , servlet , packages , serialisation , multithreading in Core and Advanced java classes . Syllabus for java / j2ee classes is according to getting a job easily. Join infocampus for best java training with the complete practical session and real time project.

To book the seat for free demo class call at 9738001024 or to get the syllabus of java course enquire at :