The document provides an overview and agenda for Struts 2.x. It discusses Struts Introduction, Struts Web Flow, Struts Architecture, Struts Basic Example, Dynamic Method Invocation, Multiple Struts.xml files, IOC and DI, Interceptors, Validation, Internationalization, Control Tags, Struts2 with Jquery, Build in Interceptor, Custom Interceptor, and I18N.
This document provides an overview of Struts 2, including:
- Struts 2 is an open source MVC framework that was originally known as WebWork 2.
- It follows the MVC architecture pattern with Actions as controllers, value stack/OGNL for models, and JSPs as views.
- The core components of Struts 2 are Actions, Interceptors, the value stack, Result types, and view technologies like JSP.
- The document discusses the Struts 2 architecture, creating a basic Struts 2 application, and additional topics like interceptors, validation, internationalization, and integrating with jQuery.
This document summarizes a presentation on the Struts 2 framework. It discusses the key components of Struts 2 including the controller, interceptors, actions, and results. It also covers the request and response cycle, architecture, differences from Struts 1, configuration file structure, tags, and the use of OGNL. The presentation provides an overview of the core functionality and design of the Struts 2 MVC framework.
The document discusses the Struts 2 framework architecture. It explains that the ActionContext stores the ValueStack which contains request data. The ValueStack holds application domain data for an action invocation and serves as the default root object for resolving OGNL expressions. Various tags like Iterator, If, Url are used to work with and retrieve data from the ValueStack. Results like DispatcherResult handles view resolution by forwarding to JSPs. The validation framework uses validators, validation metadata and domain data to validate action properties.
OGNL is an expression language used in Struts 2 to retrieve values from the value stack, which holds objects used by actions. OGNL expressions can be used in JSP views and XML configuration files to extract values. Struts 2 provides tags for control flow, data retrieval, and creating UI elements to build model-view-controller web applications. Validation can be done declaratively using XML files or programmatically in Java code.
Struts 2 uses interceptors based on the intercepting filter design pattern. It follows a pull-MVC architecture where the view layer retrieves data stored in the value stack by the controller. Interceptors are not thread-safe. Interceptors and filters both intercept requests, but interceptors are specific to Struts 2, can be configured to call methods conditionally, and replace the need for some filters. The front controller in Struts 2 is a filter rather than a servlet to avoid loading issues and allow interceptors to replace some filters. Actions serve as both models and controllers by containing business logic and data for the view. Interceptors make Struts 2 more configurable, reusable, and integrated with other frameworks compared
Struts has outgrown its reputation as a simple web framework and has become more of a brand. Because of this, two next generation frameworks are being developed within the project: Shale and Action 2.0. Action 2.0 is based on WebWork, and though its backing beans are similar to JSF, its architecture is much simpler, and easier to use.
Migrating to Struts Action 2.0 is more about unlearning Struts than it is about learning the "WebWork Way". Once you understand how simple WebWork is, you'll find that Struts Action 2.0 is a powerful framework that supports action-based navigation, page-based navigation, AOP/Interceptors, components and rich Ajax support.
Come to this session to see code comparisons and learn about migration strategies to use the kick-ass web framework of 2006.
Struts is an open source MVC framework for building Java web applications. It uses the MVC pattern and includes configurable components like actions, interceptors, and results. Struts 2 combines Struts 1 and WebWork and supports features such as AJAX, validation, dependency injection, and theming. The framework follows conventions where actions are POJOs mapped to requests and results in configuration files, with interceptors handling processing between the controller and views.
Struts2 course chapter 1: Evolution of Web ApplicationsJavaEE Trainers
The document outlines the topics covered in a Struts2 course, including evolution of web applications, Struts2 installation and configuration, actions and results, OGNL, form tags, generic tags, type conversion, input validation, internationalization, interceptors, persistence, file upload/download, security, custom interceptors, custom result types, preventing double submits, the execute and wait interceptor, decorating with Tiles and SiteMesh, zero configuration, and AJAX. It then provides more details on the evolution of web applications from no MVC to MVC model 1 and 2, and how Struts1 and Struts2 implement MVC model 2 with improvements like easier testing and reduced servlet dependencies.
This document provides an overview of Struts 2, including:
- Struts 2 is an open source MVC framework that was originally known as WebWork 2.
- It follows the MVC architecture pattern with Actions as controllers, value stack/OGNL for models, and JSPs as views.
- The core components of Struts 2 are Actions, Interceptors, the value stack, Result types, and view technologies like JSP.
- The document discusses the Struts 2 architecture, creating a basic Struts 2 application, and additional topics like interceptors, validation, internationalization, and integrating with jQuery.
This document summarizes a presentation on the Struts 2 framework. It discusses the key components of Struts 2 including the controller, interceptors, actions, and results. It also covers the request and response cycle, architecture, differences from Struts 1, configuration file structure, tags, and the use of OGNL. The presentation provides an overview of the core functionality and design of the Struts 2 MVC framework.
The document discusses the Struts 2 framework architecture. It explains that the ActionContext stores the ValueStack which contains request data. The ValueStack holds application domain data for an action invocation and serves as the default root object for resolving OGNL expressions. Various tags like Iterator, If, Url are used to work with and retrieve data from the ValueStack. Results like DispatcherResult handles view resolution by forwarding to JSPs. The validation framework uses validators, validation metadata and domain data to validate action properties.
OGNL is an expression language used in Struts 2 to retrieve values from the value stack, which holds objects used by actions. OGNL expressions can be used in JSP views and XML configuration files to extract values. Struts 2 provides tags for control flow, data retrieval, and creating UI elements to build model-view-controller web applications. Validation can be done declaratively using XML files or programmatically in Java code.
Struts 2 uses interceptors based on the intercepting filter design pattern. It follows a pull-MVC architecture where the view layer retrieves data stored in the value stack by the controller. Interceptors are not thread-safe. Interceptors and filters both intercept requests, but interceptors are specific to Struts 2, can be configured to call methods conditionally, and replace the need for some filters. The front controller in Struts 2 is a filter rather than a servlet to avoid loading issues and allow interceptors to replace some filters. Actions serve as both models and controllers by containing business logic and data for the view. Interceptors make Struts 2 more configurable, reusable, and integrated with other frameworks compared
Struts has outgrown its reputation as a simple web framework and has become more of a brand. Because of this, two next generation frameworks are being developed within the project: Shale and Action 2.0. Action 2.0 is based on WebWork, and though its backing beans are similar to JSF, its architecture is much simpler, and easier to use.
Migrating to Struts Action 2.0 is more about unlearning Struts than it is about learning the "WebWork Way". Once you understand how simple WebWork is, you'll find that Struts Action 2.0 is a powerful framework that supports action-based navigation, page-based navigation, AOP/Interceptors, components and rich Ajax support.
Come to this session to see code comparisons and learn about migration strategies to use the kick-ass web framework of 2006.
Struts is an open source MVC framework for building Java web applications. It uses the MVC pattern and includes configurable components like actions, interceptors, and results. Struts 2 combines Struts 1 and WebWork and supports features such as AJAX, validation, dependency injection, and theming. The framework follows conventions where actions are POJOs mapped to requests and results in configuration files, with interceptors handling processing between the controller and views.
Struts2 course chapter 1: Evolution of Web ApplicationsJavaEE Trainers
The document outlines the topics covered in a Struts2 course, including evolution of web applications, Struts2 installation and configuration, actions and results, OGNL, form tags, generic tags, type conversion, input validation, internationalization, interceptors, persistence, file upload/download, security, custom interceptors, custom result types, preventing double submits, the execute and wait interceptor, decorating with Tiles and SiteMesh, zero configuration, and AJAX. It then provides more details on the evolution of web applications from no MVC to MVC model 1 and 2, and how Struts1 and Struts2 implement MVC model 2 with improvements like easier testing and reduced servlet dependencies.
This document provides an overview of rule engines and Drools rule engine concepts. It discusses why rule engines are used, how rules are defined in a rule engine using conditions and actions, and how a rule engine works with a working memory. It also covers Drools rule language concepts like patterns, bindings, and rule attributes. Additionally, it summarizes complex event processing, event stream processing capabilities in Drools Fusion, and temporal reasoning. Finally, it provides some Java programming notes and references for further reading.
A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
The document provides an overview of data access with Hibernate persistent objects and persistence contexts. It discusses object state transitions and the different states an object can have (transient, persistent, detached). It also covers the Hibernate session and how it manages object identity within its scope. The summary discusses implementing equals() and hashCode() for detached objects using a business key to handle object equality outside the session scope.
Rapid development tools for java ee 8 [tut2998]Payara
Rapid Development Tools for Java EE 8 was a talk given at JavaOne 2017 about new features in Java EE 8 and tools to help with rapid development of Java EE 8 applications. It covered the Reactive Client API and JSON-B support in JAX-RS 2.1, asynchronous events and other new features in CDI 2.0 and Bean Validation 2.0, and how tools like Jeddict can generate Java EE 8 applications from models.
Struts 2 And Spring Frameworks TogetherSyed Shahul
This document discusses using the Struts 2 and Spring frameworks together. It provides code examples of integrating Spring into Struts 2 applications to manage dependencies and leverage Spring features like AOP and Spring JDBC. Examples are given of configuring Struts 2 actions as Spring beans and managing dependencies through Spring rather than direct instantiation. Benefits include reduced coupling, centralized dependency management, and ability to take advantage of Spring capabilities not in Struts 2 like transaction management.
This document discusses JPA lifecycle events and callback methods. It provides details on the different callback methods like @PrePersist, @PostPersist, etc. and describes what they are used for. It also discusses using entity listeners to attach listener classes to entities to handle lifecycle events. Multiple listener classes can be attached to a single entity class. The example shows using callbacks to automatically write user ID and timestamps to the database on inserts and updates.
Rapid Development Tools for Java EE 8 [TUT2998]Gaurav Gupta
This document provides a summary of the presentation "Rapid Development Tools for Java EE 8" given by Mert Çalışkan and Gaurav Gupta at JavaOne 2017. The presentation provides an overview of the new features in Java EE 8, including JAX-RS 2.1, CDI 2.0, Bean Validation 2.0, JSON-B, JPA 2.2, and the Java Security API 1.0. It then demonstrates tools for developing Java EE 8 applications more productively, such as the Jeddict modeler, Dynamic Code Evolution Virtual Machine, Payara tools in NetBeans, and Maven plugins. The presentation concludes with a question and answer section.
Google Guice is a dependency injection framework for Java that allows configuration through modules defined as Java classes rather than external files. It uses annotations and generics for type-safe bindings and easy refactoring. A simple example demonstrates how Guice can inject a mock DAO for tests versus a real JDBC DAO for the application by configuring different modules for the test injector and application injector. This avoids the need to directly instantiate dependencies in classes like UserController.
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6Saltmarch Media
JSR-299 (the JSR formerly known as "WebBeans") has recently turned into "Contexts and Dependency Injection for the Java EE platform". Accompanied by Last Minute JEE 6 candidate JSR-330 ("Dependency Injection for Java") the two go hand in hand while one almost seems to rip a little bit of the concept of "WebBeans" apart further. We’ll take a look their synergies and how they fit in with the rest of Java SE as well as EE.
Hibernate provides object relational mapping and allows working with data at the object level rather than directly with SQL. It abstracts the underlying database, handles change detection and caching. The session factory handles connection pooling and caching of mappings. The session represents a unit of work and tracks changes to objects, flushing updates to the database at the end of the session. The first level cache tracks changes to objects within a session. Query caching caches query results to improve performance. The second level cache caches objects beyond a single session.
Name : Prasoon Dadhich
USN : 1MS09IS069
CODE
#include <iostream>
using namespace std;
class Singleton
{
private:
static bool instanceFlag;
static Singleton *single;
Singleton()
{
//private constructor
}
public:
static Singleton* getInstance();
void method();
~Singleton()
{
instanceFlag = false;
}
};
bool Singleton::instanceFlag = false;
Singleton* Singleton::single = NULL;
Singleton* Singleton::getInstance()
{
if(! instanceFlag)
{
single = new Singleton();
instanceFlag = true;
return single;
}
else
{
return single;
}
}
void Singleton::method()
{
cout << "Method of the singleton class" << endl;
}
int main()
{
Singleton *sc1,*sc2;
sc1 = Singleton::getInstance();
sc1->method();
sc2 = Singleton::getInstance();
sc2->method();
return 0;
}
Explanation
If we create any object of this class then the static object (player) will be returned and assigned to the new object.
Finally only one object will be there. The point is not how many times something gets executed, the point is, that the work is done by a single instance of the the class. This is ensured by the class method Singleton::getInstance().
As you can see in the above code,Client can access any instance of the singleton only through the getInstance() method.Once an instance is created,the instanceFlag value becomes true and then any further objects pointers created will be given the reference to the same object that has been created.
Also,make sure you notice the presence of a private constructor.This ensures that no new objects of the class are created and that all the class pointers get the same reference to work on.
Java Persistence API is a collection of classes and methods to persistently store the vast amounts of data into a database which is provided by the Oracle Corporation.
Generally, Java developers use lots of code, or use the proprietary framework to interact with the database, whereas using JPA, the burden of interacting with the database reduces significantly. It forms a bridge between object models (Java program) and relational models (database program).
Data access patterns and technologies are discussed. The Data Access Object (DAO) pattern separates data access from business logic. Spring JDBC and myBatis provide APIs for SQL queries and object mapping. Object-relational mapping (ORM) tools like Hibernate reduce code by mapping objects to relational databases but can reduce performance. JDBC template provides basic data access while frameworks offer additional features.
Java EE 7 will focus on enabling Java EE applications and services to easily operate in public and private cloud environments. Key areas of focus include improved packaging for cloud deployment, tighter resource management, and potential new APIs for cloud services. Modularity enhancements based on Java SE 8 modules will allow applications to be composed of independent, versioned modules. The first Java EE 7 specifications have already been approved.
JDBC is used to connect Java applications to databases. It uses drivers specific to each database type. The key steps are: 1) loading the driver, 2) defining the connection URL, 3) establishing a connection, 4) creating statements to execute queries or updates, 5) processing result sets, and 6) closing connections. Prepared statements are useful for queries executed multiple times to avoid recompilation. Transactions allow grouping statements that must all succeed or fail together to maintain database consistency.
Slides from a presentation I gave on Cocoa Design Patterns - software design patterns that are suitable and common within Apple's Cocoa and Cocoa Touch frameworks using Objective C
Cook County Health and Hospitals System has provided care to millions of patients regardless of their ability to pay since 1835. It operates two hospitals, 15 community health centers, pharmacies that fill 1.9 million prescriptions annually, and is the largest provider of HIV/AIDS care in the Midwest. With over 6,736 employees including 1,600 doctors and 650 nurses, and an annual budget of $1.7 billion, Cook County Health and Hospitals System is a major healthcare provider in the region.
The document discusses corruption and its negative impacts on society. It questions why people continue to accept and breathe in corruption despite acknowledging that it chokes and kills. Corruption widens the gap between rich and poor, yet society continues in the same way without change. It reflects on whether adjusting to corruption has become the accepted way of life, without taking a break to rethink and reform. It supports those who have tried to stand up against corruption, like Anna Hazare. Overall, the document raises many questions about corruption and society's willingness or ability to end it.
This document provides an overview of rule engines and Drools rule engine concepts. It discusses why rule engines are used, how rules are defined in a rule engine using conditions and actions, and how a rule engine works with a working memory. It also covers Drools rule language concepts like patterns, bindings, and rule attributes. Additionally, it summarizes complex event processing, event stream processing capabilities in Drools Fusion, and temporal reasoning. Finally, it provides some Java programming notes and references for further reading.
A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
The document provides an overview of data access with Hibernate persistent objects and persistence contexts. It discusses object state transitions and the different states an object can have (transient, persistent, detached). It also covers the Hibernate session and how it manages object identity within its scope. The summary discusses implementing equals() and hashCode() for detached objects using a business key to handle object equality outside the session scope.
Rapid development tools for java ee 8 [tut2998]Payara
Rapid Development Tools for Java EE 8 was a talk given at JavaOne 2017 about new features in Java EE 8 and tools to help with rapid development of Java EE 8 applications. It covered the Reactive Client API and JSON-B support in JAX-RS 2.1, asynchronous events and other new features in CDI 2.0 and Bean Validation 2.0, and how tools like Jeddict can generate Java EE 8 applications from models.
Struts 2 And Spring Frameworks TogetherSyed Shahul
This document discusses using the Struts 2 and Spring frameworks together. It provides code examples of integrating Spring into Struts 2 applications to manage dependencies and leverage Spring features like AOP and Spring JDBC. Examples are given of configuring Struts 2 actions as Spring beans and managing dependencies through Spring rather than direct instantiation. Benefits include reduced coupling, centralized dependency management, and ability to take advantage of Spring capabilities not in Struts 2 like transaction management.
This document discusses JPA lifecycle events and callback methods. It provides details on the different callback methods like @PrePersist, @PostPersist, etc. and describes what they are used for. It also discusses using entity listeners to attach listener classes to entities to handle lifecycle events. Multiple listener classes can be attached to a single entity class. The example shows using callbacks to automatically write user ID and timestamps to the database on inserts and updates.
Rapid Development Tools for Java EE 8 [TUT2998]Gaurav Gupta
This document provides a summary of the presentation "Rapid Development Tools for Java EE 8" given by Mert Çalışkan and Gaurav Gupta at JavaOne 2017. The presentation provides an overview of the new features in Java EE 8, including JAX-RS 2.1, CDI 2.0, Bean Validation 2.0, JSON-B, JPA 2.2, and the Java Security API 1.0. It then demonstrates tools for developing Java EE 8 applications more productively, such as the Jeddict modeler, Dynamic Code Evolution Virtual Machine, Payara tools in NetBeans, and Maven plugins. The presentation concludes with a question and answer section.
Google Guice is a dependency injection framework for Java that allows configuration through modules defined as Java classes rather than external files. It uses annotations and generics for type-safe bindings and easy refactoring. A simple example demonstrates how Guice can inject a mock DAO for tests versus a real JDBC DAO for the application by configuring different modules for the test injector and application injector. This avoids the need to directly instantiate dependencies in classes like UserController.
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6Saltmarch Media
JSR-299 (the JSR formerly known as "WebBeans") has recently turned into "Contexts and Dependency Injection for the Java EE platform". Accompanied by Last Minute JEE 6 candidate JSR-330 ("Dependency Injection for Java") the two go hand in hand while one almost seems to rip a little bit of the concept of "WebBeans" apart further. We’ll take a look their synergies and how they fit in with the rest of Java SE as well as EE.
Hibernate provides object relational mapping and allows working with data at the object level rather than directly with SQL. It abstracts the underlying database, handles change detection and caching. The session factory handles connection pooling and caching of mappings. The session represents a unit of work and tracks changes to objects, flushing updates to the database at the end of the session. The first level cache tracks changes to objects within a session. Query caching caches query results to improve performance. The second level cache caches objects beyond a single session.
Name : Prasoon Dadhich
USN : 1MS09IS069
CODE
#include <iostream>
using namespace std;
class Singleton
{
private:
static bool instanceFlag;
static Singleton *single;
Singleton()
{
//private constructor
}
public:
static Singleton* getInstance();
void method();
~Singleton()
{
instanceFlag = false;
}
};
bool Singleton::instanceFlag = false;
Singleton* Singleton::single = NULL;
Singleton* Singleton::getInstance()
{
if(! instanceFlag)
{
single = new Singleton();
instanceFlag = true;
return single;
}
else
{
return single;
}
}
void Singleton::method()
{
cout << "Method of the singleton class" << endl;
}
int main()
{
Singleton *sc1,*sc2;
sc1 = Singleton::getInstance();
sc1->method();
sc2 = Singleton::getInstance();
sc2->method();
return 0;
}
Explanation
If we create any object of this class then the static object (player) will be returned and assigned to the new object.
Finally only one object will be there. The point is not how many times something gets executed, the point is, that the work is done by a single instance of the the class. This is ensured by the class method Singleton::getInstance().
As you can see in the above code,Client can access any instance of the singleton only through the getInstance() method.Once an instance is created,the instanceFlag value becomes true and then any further objects pointers created will be given the reference to the same object that has been created.
Also,make sure you notice the presence of a private constructor.This ensures that no new objects of the class are created and that all the class pointers get the same reference to work on.
Java Persistence API is a collection of classes and methods to persistently store the vast amounts of data into a database which is provided by the Oracle Corporation.
Generally, Java developers use lots of code, or use the proprietary framework to interact with the database, whereas using JPA, the burden of interacting with the database reduces significantly. It forms a bridge between object models (Java program) and relational models (database program).
Data access patterns and technologies are discussed. The Data Access Object (DAO) pattern separates data access from business logic. Spring JDBC and myBatis provide APIs for SQL queries and object mapping. Object-relational mapping (ORM) tools like Hibernate reduce code by mapping objects to relational databases but can reduce performance. JDBC template provides basic data access while frameworks offer additional features.
Java EE 7 will focus on enabling Java EE applications and services to easily operate in public and private cloud environments. Key areas of focus include improved packaging for cloud deployment, tighter resource management, and potential new APIs for cloud services. Modularity enhancements based on Java SE 8 modules will allow applications to be composed of independent, versioned modules. The first Java EE 7 specifications have already been approved.
JDBC is used to connect Java applications to databases. It uses drivers specific to each database type. The key steps are: 1) loading the driver, 2) defining the connection URL, 3) establishing a connection, 4) creating statements to execute queries or updates, 5) processing result sets, and 6) closing connections. Prepared statements are useful for queries executed multiple times to avoid recompilation. Transactions allow grouping statements that must all succeed or fail together to maintain database consistency.
Slides from a presentation I gave on Cocoa Design Patterns - software design patterns that are suitable and common within Apple's Cocoa and Cocoa Touch frameworks using Objective C
Cook County Health and Hospitals System has provided care to millions of patients regardless of their ability to pay since 1835. It operates two hospitals, 15 community health centers, pharmacies that fill 1.9 million prescriptions annually, and is the largest provider of HIV/AIDS care in the Midwest. With over 6,736 employees including 1,600 doctors and 650 nurses, and an annual budget of $1.7 billion, Cook County Health and Hospitals System is a major healthcare provider in the region.
The document discusses corruption and its negative impacts on society. It questions why people continue to accept and breathe in corruption despite acknowledging that it chokes and kills. Corruption widens the gap between rich and poor, yet society continues in the same way without change. It reflects on whether adjusting to corruption has become the accepted way of life, without taking a break to rethink and reform. It supports those who have tried to stand up against corruption, like Anna Hazare. Overall, the document raises many questions about corruption and society's willingness or ability to end it.
The document is a website for Soccer for Peace that uses soccer to promote peace. It contains information about their programs, which use athletics, education and dialogue, and excursions and activities to break down barriers and bring people together. The programs aim to be fun for participants and include team building, age-appropriate lessons, and opportunities for families to be involved.
Minor Presentation - Distributed file systemiamumr
This document proposes a distributed file system that stores data by indexing the locations of file blocks within the infinite non-repeating decimal expansion of pi. It would divide files into fixed or variable sized blocks, search for the block locations in pi using algorithms like Gauss-Legendre or Browein's, and store an index mapping files to block locations. Data could then be retrieved by computing the value of pi at the indexed locations using the Bailey–Borwein–Plouffe formula. However, the system has problems with high computation costs and potential for large index sizes. It suggests addressing this through GPU clustering and a virtual filesystem to enable cloud-based cold storage applications with high storage optimization.
Learn the basics of diving before attempting a dive from a starting block. Place one foot at the edge of the block and the other shoulder-width behind, facing the pool. When instructed, crouch down low by bending at the thighs and grabbing the front of the block. Push off powerfully with arms and legs, streamlining the body to enter the water without injury. Perfect your dive technique with a coach's guidance to have the fastest start in a race.
This document summarizes a dissertation submitted by Xi Zhu to the University of Bristol examining differences in compliment responses between Chinese ESL students in the UK and native British speakers. The study used questionnaires and interviews to collect compliment response data from 12 students in each group across various scenarios varying social variables like gender and social status. The results showed both groups generally preferred to accept compliments, except for personality compliments which were often evaded. Chinese ESL students were less likely to reject compliments and more ambiguous. Both groups considered social relations and power differences but not gender. The study provides insights into cross-cultural similarities and differences in politeness strategies between the groups.
The document is a risk registry for emergency situations in Romania listing various types of risks and indicating which localities and emergency response units have capabilities to respond immediately to each type of risk. It includes natural risks like floods, snowfalls, fires, landslides as well as technological and man-made risks like industrial accidents, transport accidents, nuclear incidents, pollution and infrastructure collapses. Each locality's emergency response unit is assessed for its immediate intervention capabilities regarding each of the listed risks.
M.E.B Onaylı 45 Saatlik Eğiticinin Eğitimi Sertifikası "İş Güvenliği Uzmanı, İşyeri Hekimi, İşyeri Hemşiresi v.b" pozisyonlarda çalışabilmek için bakanlık tarafından zorunlu tutulan bir eğitimdir.
Ana Pérez Marrufo es una asistente que trabaja para una empresa. Tiene 25 años y vive en Madrid. Estudió administración de empresas en la universidad y lleva 3 años trabajando como asistente en su actual puesto.
GAME PLAN FOR 2017 GENERAL ELECTION MARCH-2015samuel mutemi
The document provides population and voter registration projections for several counties in Kenya between 2009 and 2017. It summarizes voter turnout data from 2013 and uses the figures to project numbers of eligible voters, registered voters, projected voter turnout, and total lost votes for each county in 2017. Counties included are Nairobi, Machakos, Kiambu, Mombasa, Kisumu, Bungoma and others. Assumptions are made about population growth rates, death rates, percentages of populations that will register to vote and turnout rates.
LILO is a bootloader that loads Linux and other operating systems from hard disks or floppy disks. It uses configuration settings stored in /etc/lilo.conf to define boot options and locations of operating system images. LILO builds tables mapping sectors used by files needed for booting and must be reinstalled when changes are made. It loads operating systems by BIOS routines and has limitations including slow loading, limited number of boot options, and BIOS restrictions on disk access.
This ppt tells about struts in java. All the methods and brief knowledge of struts. For more info about struts and free projects on it please visit : http://s4al.com/category/study-java/
Struts 2 is an open source MVC framework for building Java web applications that uses a simplified front controller design pattern and implements the MVC architecture with components like actions, interceptors, and views. It addresses some limitations of Struts 1 by having a simplified design, easier testing, support for annotations and AJAX, and removes dependencies on specific servlet APIs. The key components needed to start using Struts 2 are a Java 5.0 JDK and Tomcat 5.x or higher to provide the servlet and JSP APIs.
Struts is a web application framework that uses the MVC design pattern. It combines Java servlets, JavaServer Pages, custom tags and message resources. Struts acts as a controller in MVC that routes requests between the view (JSPs) and the model (business logic classes). Struts is open source software hosted by the Apache Software Foundation. It provides a standard way to build Java web applications by separating the application logic from the user interface.
Struts 2 is a web application framework based on the Model-View-Controller (MVC) pattern. It automates common tasks to make developing large web applications easier and faster. Struts 2 uses interceptors and actions to implement the MVC pattern, with actions representing the model, results representing views, and a filter dispatcher acting as the controller. Developers can declare the framework's architecture either through XML configuration files or Java annotations.
The document discusses the Struts framework, including its advantages in solving software development challenges through reusable components. It describes the Model-View-Controller architecture that Struts uses, with the controller directing requests to models for data and views for presentation. Key aspects of Struts like configuration files, actions, forms, tags and internationalization are explained at a high level.
This document discusses interceptors in Apache Struts 2.x. It defines interceptors as code that can execute before and after actions to handle common concerns like validation. The document explains how interceptors are configured and some built-in interceptors like ParametersInterceptor and ValidationInterceptor. It also outlines the disadvantages of Struts like its large learning curve and rigid approach compared to standard Java web development.
The document provides an overview of Struts, an open source MVC framework for building web applications in Java. It discusses the key components of Struts, including the controller, request processor, actions, and action mappings. The controller acts as the central coordinator and uses action mappings configured in XML to route requests to the appropriate actions. Actions perform business logic and return a forwarding path. The framework handles request processing and forwarding the response to the corresponding view.
The document provides an overview of the Struts framework, including its advantages and components. It discusses the Model 1 and Model 2 architectures, and explains that Struts implements the MVC pattern. It describes the controller elements like the action servlet and request processor, the model components like Java classes and beans, and the view components like JSP tag libraries. The document also provides examples of how Struts can be implemented in a sample application.
The document provides answers to 12 interview questions about the Struts framework. It defines key concepts like MVC, frameworks, Struts framework, ActionServlet, Action classes, ActionForms, validation, and RequestProcessor. The questions and answers cover the responsibilities and roles of these core Struts components and how they implement the MVC architecture.
Struts2.x is a MVC framework that implements the MVC pattern using Java technologies. It divides an application into model, view, and controller components. The model are Java classes that represent the application's data and business logic. Views are JSP pages that represent the user interface. The controller is a servlet filter that routes requests to actions and returns the appropriate view. Struts provides tags and libraries that make building MVC web apps with features like validation easier compared to plain JSP/Servlet programming.
The document provides an overview of the Struts framework, including its MVC architecture and core components. It discusses the controller, model, and view components of Struts and how they work together. It also covers configuring a Struts application, using validation and tiles frameworks, and provides a sample application to demonstrate Struts.
This document provides an overview and summary of the Struts framework for building web applications:
- The Struts framework is based on the Model-View-Controller (MVC) architecture which divides applications into the model, view, and controller layers.
- Struts implements the front controller pattern where requests are handled by a central controller servlet that dispatches requests to application components.
- The framework provides tags and utilities to build web forms and interfaces, internationalization support, and an extensible validation framework.
- Configuration is done via XML files which define mappings, form beans, validators, and other application settings.
- An example application demonstrates common design patterns used with Struts like actions that
This document discusses the SSH model, which is a Java web application framework that uses Struts for the presentation layer, Spring for the business layer, and Hibernate for the persistence layer. It provides overviews of Struts, Spring, and Hibernate individually, including their components and functions. It then discusses the disadvantages of each framework and how to integrate Struts and Spring and Hibernate and Spring. The integration allows the frameworks to work together effectively. Finally, it provides an example of how the frameworks can be used together in an application with Struts for the frontend, Hibernate for data access, and Spring as the core framework.
This document provides an introduction and overview of Struts 2.0, including what Struts is, why to use a framework, the main components and architecture of Struts 2.0, how the request lifecycle works, the differences between Struts 1.x and 2.0, and what is needed to start using Struts 2.0. It covers topics such as Struts being an open source MVC framework, its use of interceptors and actions, and how Struts 2.0 simplified the design and improved testability compared to previous versions.
Struts 2 uses the Model-View-Controller (MVC) pattern for building web applications. The key components are:
1. Controller: The FilterDispatcher acts as the controller and maps requests to actions.
2. Model: Actions serve as the model, encapsulating business logic and acting as a data transfer locus between the request and view.
3. View: Results represent the view and render the output.
Actions return a result string to select the appropriate result for rendering. Data is stored in the ValueStack, a central data repository accessible via OGNL expressions. Interceptors handle cross-cutting concerns like validation before and after actions execute.
Interceptors are conceptually the same as servlet filters or the JDKs Proxy class. Interceptors allow for crosscutting functionality to be implemented separately from the action as well as the framework.
The document provides an overview of Struts 2 including:
1. The architecture of Struts 2 which uses patterns like front controller and composite.
2. A basic "Hello World" example demonstrating creating an action class and mapping it in struts.xml.
3. The Action interface and ActionSupport class which provides common functionality like validation. ActionSupport implements interfaces like Validateable.
4. Aware interfaces like SessionAware which allow injecting objects like the session into actions.
D22 Portlet Development With Open Source FrameworksSunil Patil
The document discusses various frameworks that can be used for portlet development, including the Struts Portlet Framework and Spring 2.0. It provides an overview of the Struts Portlet Framework, describing its runtime components and tooling support. It also summarizes key concepts in Struts 2.0 like actions, interceptors, and the value stack. The document recommends frameworks like JSF and Struts 2.0 for new portlet development and considers factors like skills availability and complexity.
D22 portlet development with open source frameworksSunil Patil
The document discusses various frameworks for portlet development including Struts, Spring, and JSF. It provides details on the Struts Portlet Framework and Struts 2.0 framework, including their key components, architecture, and how they can be used to build portlet applications.
The document discusses web application frameworks and provides examples using Apache Struts 2 and Spring frameworks. It defines a web application framework as software designed to support dynamic website and web application development. It then covers key aspects of the Struts 2 and Spring frameworks like the MVC architecture, configuration, tag libraries, and provides a Hello World example using Struts 2.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
Batteries -Introduction – Types of Batteries – discharging and charging of battery - characteristics of battery –battery rating- various tests on battery- – Primary battery: silver button cell- Secondary battery :Ni-Cd battery-modern battery: lithium ion battery-maintenance of batteries-choices of batteries for electric vehicle applications.
Fuel Cells: Introduction- importance and classification of fuel cells - description, principle, components, applications of fuel cells: H2-O2 fuel cell, alkaline fuel cell, molten carbonate fuel cell and direct methanol fuel cells.
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMHODECEDSIET
Time Division Multiplexing (TDM) is a method of transmitting multiple signals over a single communication channel by dividing the signal into many segments, each having a very short duration of time. These time slots are then allocated to different data streams, allowing multiple signals to share the same transmission medium efficiently. TDM is widely used in telecommunications and data communication systems.
### How TDM Works
1. **Time Slots Allocation**: The core principle of TDM is to assign distinct time slots to each signal. During each time slot, the respective signal is transmitted, and then the process repeats cyclically. For example, if there are four signals to be transmitted, the TDM cycle will divide time into four slots, each assigned to one signal.
2. **Synchronization**: Synchronization is crucial in TDM systems to ensure that the signals are correctly aligned with their respective time slots. Both the transmitter and receiver must be synchronized to avoid any overlap or loss of data. This synchronization is typically maintained by a clock signal that ensures time slots are accurately aligned.
3. **Frame Structure**: TDM data is organized into frames, where each frame consists of a set of time slots. Each frame is repeated at regular intervals, ensuring continuous transmission of data streams. The frame structure helps in managing the data streams and maintaining the synchronization between the transmitter and receiver.
4. **Multiplexer and Demultiplexer**: At the transmitting end, a multiplexer combines multiple input signals into a single composite signal by assigning each signal to a specific time slot. At the receiving end, a demultiplexer separates the composite signal back into individual signals based on their respective time slots.
### Types of TDM
1. **Synchronous TDM**: In synchronous TDM, time slots are pre-assigned to each signal, regardless of whether the signal has data to transmit or not. This can lead to inefficiencies if some time slots remain empty due to the absence of data.
2. **Asynchronous TDM (or Statistical TDM)**: Asynchronous TDM addresses the inefficiencies of synchronous TDM by allocating time slots dynamically based on the presence of data. Time slots are assigned only when there is data to transmit, which optimizes the use of the communication channel.
### Applications of TDM
- **Telecommunications**: TDM is extensively used in telecommunication systems, such as in T1 and E1 lines, where multiple telephone calls are transmitted over a single line by assigning each call to a specific time slot.
- **Digital Audio and Video Broadcasting**: TDM is used in broadcasting systems to transmit multiple audio or video streams over a single channel, ensuring efficient use of bandwidth.
- **Computer Networks**: TDM is used in network protocols and systems to manage the transmission of data from multiple sources over a single network medium.
### Advantages of TDM
- **Efficient Use of Bandwidth**: TDM all
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
2. Agenda
Struts Introduction
Struts Web Flow
Struts Architecture
Struts Basic Example
Dynamic Method Invocation
Multiple Struts.xml files
IOC and DI
Interceptors
Validation
Internationalization
Control Tags
Struts2 with Jquery
Build in Interceptor
Custom Interceptor
I18N
3. Struts2 is a free Open Source Framework
Apache Struts2 was originally known as WebWork 2. After working independently
for several years, the WebWork and Struts communities joined forces to create
Struts2.
It is based on MVC2 Architecture
In Struts 2 FilterDispatcher does the job of Controller.
Model contains the data and the business logic.
In Struts 2 the model is implemented by the Action component.
View is the presentation component of the MVC Pattern.
In Struts 2 View is implemented by JSP
Struts 2 is a pull-MVC framework. i.e. the data that is to be displayed to user has to
be pulled from the Action.
The “pull” comes from the views ability to pull data from an action using Value
Stack/OGNL.
Struts 2 Action class are plain POJO objects thus simplifying the testing of the code.
Struts Introduction
5. Servlet
(Controller)
Servlet
(Controller)
1. Get Request parameters
Business Service
(Model)
Business Service
(Model)
2. Call Business Service
DBDB
Business Service talk to DB
JSP
(View)
JSP
(View)
3. Pass the result to the JSP
4. Return Formatted HTML
MVC
6. Why MVC
1. Business Logic (Model) is separate from controller.
2. View is separate from Controller
3. View is separate from Model
Conclusion : MVC Follows Separation of Concern Principal.
7. MVC Framework
1. It provide pre-build classes
2. It is a collections of Base classes and Jars
3. They are Extensible
4. Popular Java MVC are
Struts 1.x , Struts 2.x , JSF , Wicket , Spring MVC, Play, Grails
8. Framework vs Pattern
1. Pattern is the way you can architect your application.
2. Framework provides foundation (base) classes and
libraries.
3. Leverage industry best practices.
10. Five Core Components:
1. Actions
The most basic unit of work that can be associated with a HTTP request coming from a user.
2. Interceptors
They provide a way to supply pre-processing and post-processing around the action. They have access to
the action being executed, as well as all environmental variables and execution properties.
Interceptors are conceptually the same as servlet filters, can be layered and ordered.
3. Value stack / OGNL.
The value stack is exactly what it says it is – a stack of objects. OGNL stands for Object Graph
Navigational Language, and provides the unified way to access objects within the value stack.
4. Result types
Chain, Dispatcher, Freemarker, HttpHeader, Redirect, Redirect-Action, Stream, Velocity, XSLT.
If the attribute is not supplied, the default type “dispatcher” is used – this will render a JSP result.
5. View technologies.
JSP
Velocity Templates
Free marker Templates
XSLT Transformations
Struts 2 Core Components
11. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
It is optional Filter
, and it is used to
integrate the Struts
with SiteMesh Plugin
Struts Architecture
12. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
SiteMesh is a web-page
layout and decoration
framework and web
application integration
framework to aid in
creating large sites
consisting of many
pages for which a
consistent look/feel,
navigation and layout
scheme is required.
Struts Architecture
13. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
The FilterDispatcher filter is
called which consults the
ActionMapper to determine
whether an Action should
be invoked
Struts Architecture
14. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
If ActionMapper finds an Action
to be invoked, the FilterDispatcher
delegates control to ActionProxy.
Struts Architecture
15. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
tionProxy reads the configuration
e such as struts.xml.
tionProxy creates an instance
ActionInvocation class and
legates the control.
Struts Architecture
16. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
onInvocation is responsible
nvokes the Interceptors one by
(if required) and then invoke
Action.
Struts Architecture
17. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
Once the Action returns, the
ActionInvocation is
esponsible for looking up
the proper result associated
with the Action result code
mapped in struts.xml.
Struts Architecture
18. Architecture of Struts 2
Struts 2 Architecture is based on WebWork 2 framework. It leverages the standard JEE
technologies such as Java Filters, JavaBeans, ResourceBundles, Locales, XML etc in its
architecture.
Interceptors are executed
ain in reverse order and the
onse is returned to the Filter
most cases to FilterDispatcher).
the result is then sent to the
let container which in turns
d it back to client
Struts Architecture
20. Struts Basic Example
Struts First Program
For Creating Struts First Program, You required the Following things
a) JDK 1.5 or Higher
b) Servlet API and JSP API
c) J2EE Compliance Web Server or Application Server
d) Download the Following Jar Files from http://struts.apache.org/download.cgi
33. Struts 1.x v/s Struts 2.x
Feature Struts 1.x Struts 2.x
Action
Classes
Struts 1 requires Action
classes to extend an
abstract base class. A
common problem in
Struts 1 is programming
to abstract classes
instead of interfaces.
An Struts 2 Action may implement
an Action interface, along with
other interfaces to enable optional
and custom services. Struts 2
provides a base ActionSupport class
to implement commonly used
interfaces. Albeit, the Action
interface is not required. Any POJO
object with a execute signature can
be used as an Struts 2 Action
object.
Binding
Values
into
views
To access different
objects , struts 1 uses
the standard jsp implict
objects
It use valuestack to hold the values
and to reterive the value from value
stack it use OGNL (Object Graph
Navigational Language)
Servlet
Depende
ncy
In action execute
method , it has
HttpServletRequest and
HttpServletResponse
Object, both comes from
servlet API
Not needed in struts 2 execute
method
Testablit A major hurdle to Struts 2 Actions can be tested by
34. Multiple Struts.xml File
We can include other struts.xml-format files from a bootstrap struts.xml file
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file=“advice.xml"/>
<include file=“contract.xml"/>
<include file=“dms.xml"/>
</struts>
39. Designing UI in Struts 2
The form Tag
Eg.
<s:form action=“actionname” method =“post”>
</s:form>
The textfield tag
<s:textfield name=“userid” label =“userid” />
The TextArea tag
<s:textarea name=“address” label=“Address” cols=“15” rows=“2” />
UI
40. The password tag
<s:password name=“password” label=“Password” />
The Checkbox Tag
<s:checkbox name=“cricket” label=“Cricket” fieldValue=“C”/>
<s:checkbox name=“hockey” label=“Hockey” fieldValue=“H”/>
The Radio Tag
<s:radio name=“m_status” label=“Marital Status” list=“{‘Single’,’Married’}” />
The Hidden Tag
<s:hidden name=“empid” value=“Some Value” />
UI
41. The Combo box
<s:combobox label=“Country" headerKey="-1" headerValue="--- Select ---" list=“country"
name=“country" />
class Action extends ActionSupport
{
private List<String> country;
public void setCountry(List<String> country) { }
public List<String> getCountryList() { }
}
The submit tag
<s:submit/>
The datetimepicker tag
<s:datetimepicker name=“dob” label =“Date of Birth” displayFormat="dd MMMM,
yyyy" />
UI
43. FreeMarker is a "template engine"; a generic tool to generate text output
To Print the Values in FTL
Welcome ${user}
If condition in FTL
<#if field.formatType??>
</#if>
Loops in FTL
<#list tabList as page>
</#list>
Freemarker
44. Creating Own Components Using FTL
Eg. Creating Password Field Using FTL
<input type="password" <#rt/>
name="${parameters.name?default("")?html}"<#rt/>
<#if parameters.get("size")??>
size="${parameters.get("size")?html}"<#rt/>
</#if>
<#if parameters.maxlength??>
maxlength="${parameters.maxlength?html}"<#rt/>
</#if>
<#if parameters.id??>
id="${parameters.id?html}"<#rt/>
</#if>
<#if parameters.get("size")??>
size="${parameters.get("size")?html}"<#rt/>
</#if>
<#if parameters.onblur??>
onblur="${parameters.onblur?html}"<#rt/>
</#if>
/>
NOTE: Store your FTL File in public-html template finnonepro
Freemarker
45. Calling FTL using <s:component tag> , place in JSP File
<s:component template="password.ftl" theme="finnonepro" id="28000005"
name="FW_SC_PW_OodPW">
<s:param name="maxlength" value="'20'"/>
<s:param name="size" value="'12'"/>
<s:param name="mandatory" value="'Y'"/>
</s:component>
Freemarker
46. IOC (Inversion of Control) and DI (Dependency Injection)
IOC and DI are programming design patterns, which are used to reduce coupling in
programming.
It follow the Following Principle:
a) You do not need to create your objects. You need to only describe how they should
be created. (This think is done by ObjectFactory)
To enable the IOC in Struts
a) Using an Enabler Interface
Eg. SessionAware, ApplicationAware etc.
IOC (Inversion of Control)
48. Exercise:
Create an Online Shopping Application, where user can login and register if the User is
New. Once User login in the System , the Application display the items to the User , so
User can choose it and buy the desire item. The Selected Item has the given features like
Item Name , Size , Color , Quantity and Price.
Once the User buy the selected item , the final bill is generated and display to the User
49. Interceptor
Interceptor is used for seperation of core functionality code in the form of
Interceptors makes Action more lightweight.
The purpose of Interceptors is to allow greater control over controller layer and
separate some common logic that applies to multiple actions.
All framework interceptors defined in struts-default.xml
Interceptors
50. Alias Interceptor
Alias Interceptor
This interceptor alias a named parameter to a different parameter name.
Suppose your jsp having two textfield name t1 and t2 and in your action class you defined t3
and t4 variable , so alias interceptor can map t1 with t3 alias and t2 with t4 alias.
56. ExecuteAndWait Interceptor
While running a long action, the user may get impatient in case of a long delay in
response. To avoid this, the execAndWait Interceptor is used, which runs a long
running action in the background and display a page with a Loading to the user.
60. Step -4 Create struts.xml
an initial delay
in millis to wait
before the wait page is shown
Used for waking up at
certain intervals to check
if the background process is
already done. Default is
100 millis
61. Exception Interceptor
The Struts 2 framework provides the functionality of exception handling through the
Interceptor. Instead of displaying stack trace for the exception to the user, it is always
good to show a nicely designed page describing the real problem to the user.
66. Creating Own Interceptor
This framework provides the flexibility to create own interceptor classes to enable
additional logic which can be separated and refused in the Interceptor stack of different
action classes.
The Custom interceptor class need to be defined in the struts.xml file.
69. Validation Framework
Struts 2 based on a validation framework, which is provided by Xwork.
The Validation framework uses external metadata in the form of XML files to describe
what validation should be performed on your action.
Struts2 Validation Framework allows us to separate the validation logic from actual
Java/JSP code, where it can be reviewed and easily modified later.
Validation can be perform
a) Programmatic
b) XML Meta Data
Validation Framework
75. Step -4 struts.xml
Note: validation.xml file placed in the same location , where Action is placed and it
is same name as action name and end with validation.xml file
76. Programmatic Validation
It is written in the Actionclass by overriding the
validate method , this method calls automatically
when user submit the page, it is call before the
execute method , and if any error occurred , it return
the “input” as a result , otherwise it execute the
execute method of the action
77. Step -1 Create an Action
Override the validate method
it comes from Validateable
interface, which is
implemented by
ActionSupport class
78. Internationalization
Internationalization is a technique for application development that support multiple
languages and data formats without having to rewrite programming logic.
Create different languages
application resource property file’s
and these files name end
with country language code
Note: Also Specify the application resource name and path in
struts.properties file, the path is required if you are not placed in
application resoource file in the src folder