Suche senden
Hochladen
Struts Interceptors
•
2 gefällt mir
•
1,141 views
Onkar Deshpande
Folgen
Introduction to Struts Framework and Struts Interceptors
Weniger lesen
Mehr lesen
Software
Melden
Teilen
Melden
Teilen
1 von 25
Empfohlen
Spring Security 5
Spring Security 5
Jesus Perez Franco
Intro to vue.js
Intro to vue.js
TechMagic
Spring Boot and REST API
Spring Boot and REST API
07.pallav
REST APIs with Spring
REST APIs with Spring
Joshua Long
Spring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
Node js Modules and Event Emitters
Node js Modules and Event Emitters
TheCreativedev Blog
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC
How to Convert a Component Design into an MUI React Code
How to Convert a Component Design into an MUI React Code
WrapPixel
Empfohlen
Spring Security 5
Spring Security 5
Jesus Perez Franco
Intro to vue.js
Intro to vue.js
TechMagic
Spring Boot and REST API
Spring Boot and REST API
07.pallav
REST APIs with Spring
REST APIs with Spring
Joshua Long
Spring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
Node js Modules and Event Emitters
Node js Modules and Event Emitters
TheCreativedev Blog
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC
How to Convert a Component Design into an MUI React Code
How to Convert a Component Design into an MUI React Code
WrapPixel
Express node js
Express node js
Yashprit Singh
Introduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
Module design pattern i.e. express js
Module design pattern i.e. express js
Ahmed Assaf
Spring mvc
Spring mvc
Harshit Choudhary
Spring Boot
Spring Boot
Jiayun Zhou
Spring boot
Spring boot
Pradeep Shanmugam
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
JWORKS powered by Ordina
RESTful Web Services
RESTful Web Services
Christopher Bartling
ASP.NET Web API
ASP.NET Web API
habib_786
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
Spring security
Spring security
Saurabh Sharma
Building an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
Christopher Foresman
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Sam Brannen
Node.js File system & Streams
Node.js File system & Streams
Eyal Vardi
Arquitetura Node com NestJS
Arquitetura Node com NestJS
Vanessa Me Tonini
Swagger / Quick Start Guide
Swagger / Quick Start Guide
Andrii Gakhov
Server side rendering review
Server side rendering review
Vladyslav Morzhanov
Spring Web MVC
Spring Web MVC
zeeshanhanif
Spring Boot Tutorial
Spring Boot Tutorial
Naphachara Rattanawilai
React workshop
React workshop
Imran Sayed
Struts Interview Questions
Struts Interview Questions
jbashask
Struts2
Struts2
shankar_b7
Weitere ähnliche Inhalte
Was ist angesagt?
Express node js
Express node js
Yashprit Singh
Introduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
Module design pattern i.e. express js
Module design pattern i.e. express js
Ahmed Assaf
Spring mvc
Spring mvc
Harshit Choudhary
Spring Boot
Spring Boot
Jiayun Zhou
Spring boot
Spring boot
Pradeep Shanmugam
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
JWORKS powered by Ordina
RESTful Web Services
RESTful Web Services
Christopher Bartling
ASP.NET Web API
ASP.NET Web API
habib_786
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
Spring security
Spring security
Saurabh Sharma
Building an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
Christopher Foresman
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Sam Brannen
Node.js File system & Streams
Node.js File system & Streams
Eyal Vardi
Arquitetura Node com NestJS
Arquitetura Node com NestJS
Vanessa Me Tonini
Swagger / Quick Start Guide
Swagger / Quick Start Guide
Andrii Gakhov
Server side rendering review
Server side rendering review
Vladyslav Morzhanov
Spring Web MVC
Spring Web MVC
zeeshanhanif
Spring Boot Tutorial
Spring Boot Tutorial
Naphachara Rattanawilai
React workshop
React workshop
Imran Sayed
Was ist angesagt?
(20)
Express node js
Express node js
Introduction to Spring Boot
Introduction to Spring Boot
Module design pattern i.e. express js
Module design pattern i.e. express js
Spring mvc
Spring mvc
Spring Boot
Spring Boot
Spring boot
Spring boot
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
RESTful Web Services
RESTful Web Services
ASP.NET Web API
ASP.NET Web API
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Spring security
Spring security
Building an API with Django and Django REST Framework
Building an API with Django and Django REST Framework
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
Node.js File system & Streams
Node.js File system & Streams
Arquitetura Node com NestJS
Arquitetura Node com NestJS
Swagger / Quick Start Guide
Swagger / Quick Start Guide
Server side rendering review
Server side rendering review
Spring Web MVC
Spring Web MVC
Spring Boot Tutorial
Spring Boot Tutorial
React workshop
React workshop
Ähnlich wie Struts Interceptors
Struts Interview Questions
Struts Interview Questions
jbashask
Struts2
Struts2
shankar_b7
Struts 2 Overview
Struts 2 Overview
skill-guru
Struts 2-overview2
Struts 2-overview2
Long Nguyen
Struts ppt 1
Struts ppt 1
pavanteja86
Struts course material
Struts course material
Vibrant Technologies & Computers
important struts interview questions
important struts interview questions
surendray
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
Sunil Patil
D22 portlet development with open source frameworks
D22 portlet development with open source frameworks
Sunil Patil
Struts 2-overview2
Struts 2-overview2
divzi1913
Skillwise Struts.x
Skillwise Struts.x
Skillwise Group
Struts(mrsurwar) ppt
Struts(mrsurwar) ppt
mrsurwar
Struts Into
Struts Into
Vijay subedar
01 Struts Intro
01 Struts Intro
sdileepec
SERVER SIDE PROGRAMMING
SERVER SIDE PROGRAMMING
Prabu U
MVC
MVC
akshin
vRO Training Document
vRO Training Document
Mayank Goyal
Struts 2 - Introduction
Struts 2 - Introduction
Hitesh-Java
Struts Ppt 1
Struts Ppt 1
JayaPrakash.m
Asp.net,mvc
Asp.net,mvc
Prashant Kumar
Ähnlich wie Struts Interceptors
(20)
Struts Interview Questions
Struts Interview Questions
Struts2
Struts2
Struts 2 Overview
Struts 2 Overview
Struts 2-overview2
Struts 2-overview2
Struts ppt 1
Struts ppt 1
Struts course material
Struts course material
important struts interview questions
important struts interview questions
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
D22 portlet development with open source frameworks
D22 portlet development with open source frameworks
Struts 2-overview2
Struts 2-overview2
Skillwise Struts.x
Skillwise Struts.x
Struts(mrsurwar) ppt
Struts(mrsurwar) ppt
Struts Into
Struts Into
01 Struts Intro
01 Struts Intro
SERVER SIDE PROGRAMMING
SERVER SIDE PROGRAMMING
MVC
MVC
vRO Training Document
vRO Training Document
Struts 2 - Introduction
Struts 2 - Introduction
Struts Ppt 1
Struts Ppt 1
Asp.net,mvc
Asp.net,mvc
Kürzlich hochgeladen
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
masabamasaba
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
masabamasaba
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
WSO2
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Bert Jan Schrijver
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
masabamasaba
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
masabamasaba
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
masabamasaba
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
masabamasaba
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
SelfMade bd
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
Presentation.STUDIO
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
masabamasaba
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
Kürzlich hochgeladen
(20)
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
Struts Interceptors
1.
STRUTS INTERCEPTORS ©
Onkar Deshpande
2.
Agenda What
is Apache Struts 2.x ? Features of Apache Struts 2.x How Struts 2.x works ? Struts 2.x Architecture Overview Struts 2.0 MVC Components Request – Response Pipeline Interceptors Need of Interceptors Understanding the Difference Between Filters & Interceptors Configuring Interceptor Frameworks(In-built) Interceptors Custom Inceptors Disadvantages of Struts 2 © Onkar Deshpande
3.
What is Apache
Struts 2.x? Apache Struts 2 is an Open Source, elegant & extensible framework for creating enterprise-ready Java web applications The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time It is Action Based Framework Cerate's web application using MVC 2 architecture Apache Struts offer two major version Struts 1.x Struts 2.x Struts 2 = WebWork + Struts 3 © Onkar Deshpande
4.
Features of Struts
2.x MVC Framework Struts provides a unified framework for deploying servlet and JSP applications that use the MVC architecture A Set of JSP Custom Tag Libraries Struts provides custom tag libraries for outputting bean properties, generating HTML forms, iterating over various types of data structures, and conditionally outputting HTML A Collection of Utilities Struts provides utility classes to handle many of the most common tasks in Web application development 4 © Onkar Deshpande
5.
Features of Struts
2.x continued… Centralized file-based configuration Rather then hard-coding information into Java programs, many Struts values are represented in XML or property files. This loose coupling means that many changes can be made without modifying or recompiling Java code, and that wholesale changes can be made by editing a single file. This approach also lets Java and Web developers focus on their specific tasks (implementing business logic, presenting certain values to clients, etc.) without needing to know about the overall system layout 5 © Onkar Deshpande
6.
Features of Struts
2.x continued… HTML tags Apache Struts provides a set of custom JSP tags to create HTML forms that are associated with JavaBeans components. This bean/form association serves two useful purposes: It lets you get initial form-field values from Java objects It lets you redisplay forms with some or all previously entered values intact 6 © Onkar Deshpande
7.
Features of Struts
2.x continued… Form field validation Apache Struts has builtin capabilities for checking that form values are in the required format. If values are missing or in an improper format, the form can be automatically redisplayed with error messages and with the previously entered values maintained This validation can be performed on the server (in Java), or both on the server and on the client (in JavaScript) Consistent approach Struts encourages consistent use of MVC throughout your app 7 © Onkar Deshpande
8.
8 How Struts
2.x works? © Onkar Deshpande
9.
Struts 2.x Architecture
Overview 9 © Onkar Deshpande
10.
Struts 2.x Architecture
Overview 10 © Onkar Deshpande
11.
Struts 2.0 MVC
Components Core components of the framework Controller:- Filter Dispatcher:- First component that start processing that is why this type of MVC is called front controller MVC Looks at the request and apply the appropriate action. Struts framework handles all of the controller work. Its configured in web.xml Interceptors:- Can execute code before and after an Action is executed. They can be configured per action basis. Can be used for data validation, file upload, double submit guards. 11 © Onkar Deshpande
12.
Struts 2.0 MVC
Components contd. Model:- Implemented by action class For model you can use any data access technologies like JDBC,EJB,Hibernate View Its your result part. It can be JSP,JSTL,JSF etc. Presentation part of the MVC 12 © Onkar Deshpande
13.
Request – Response
Pipeline 13 © Onkar Deshpande
14.
Need of Interceptors
Many Actions share common concerns Some Actions need input validated The framework makes it easy to share solutions to these concerns using an "Interceptor" strategy Interceptors can execute code before and after an Action is invoked Interceptors "set the stage" for the Action classes 14 © Onkar Deshpande
15.
15 Interceptor Looks
like Filters © Onkar Deshpande
16.
Understanding the Difference
Filters Interceptors Based on Servlet Specification Based on Struts2. Executes on the pattern matches on the request. Executes for all the request qualifies for a front controller( A Servlet filter ).And can be configured to execute additional interceptor for a particular action execution. Not configurable method calls Methods in the Interceptors can be configured whether to execute or not by means of excludemethods or includeMethods A Servlet Filter is used in the web layer only, you can’t use it outside of a web context. Interceptors can be used anywhere. That’s the main difference. for authentication of web pages you would use a servlet filter For security stuff in your business layer or logging/bugtracing (a.k.a. 16 © Onkar Deshpande
17.
Understanding Interceptors 17
© Onkar Deshpande
18.
Understanding Interceptors Continued…
18 © Onkar Deshpande
19.
Configuring Interceptor
<action name="login" class=“pack.className"> <interceptor-ref name="timer"/> <interceptor-ref name="logger"/> <result name="input">login.jsp</result> <result name="success“ type="redirectAction">home</result> </action> 19 © Onkar Deshpande
20.
Frameworks(In-built) Interceptors
ParametersInterceptor It sets request parameter into the action This interceptor gets all parameters from request and sets them on the value stack, typically resulting in the values submitted in a form request being applied to an action in the value stack AliasInterceptor Converts similar parameters that may be named differently between requests 20 © Onkar Deshpande
21.
Frameworks(In-built) Interceptors cont..
ServletConfigInterceptor An interceptor which sets action properties based on the interfaces an action implements For example, if the action implements ServletRequestAware interface then setting of HttpServletRequest is done by this interceptor This interceptor is designed to set all properties an action needs if it's aware of servlet parameters, the servlet context, the session, etc 21 © Onkar Deshpande
22.
Frameworks(In-built) Interceptors cont..
WorkflowInterceptor An interceptor that makes sure there are not validation errors before allowing the interceptor chain to continue This interceptor does not perform any validation ValidationInterceptor This interceptor runs the action through the standard validation framework It checks the action against any validation rules (found in files such as ActionClass-validation.xml) The workflow of the action request does not change due to this interceptor Rather, this interceptor is often used in conjuction with the workflow interceptor 22 © Onkar Deshpande
23.
Disadvantages of Struts
Bigger learning curve To use MVC with the standard RequestDispatcher, you need to be comfortable with the standard JSP and servlet APIs. To use MVC with Struts, you have to be comfortable with the standard JSP and servlet APIs and a large and elaborate framework that is almost equal in size to the core system. This drawback is especially significant with smaller projects, near-term deadlines, and less experienced developers; you could spend as much time learning Struts as building your actual system Poor documentation Compared to the standard servlet and JSP APIs, Struts has fewer online resources, and many first-time users find the online Apache documentation confusing and poorly organized. There are also fewer books on Apache Struts than on standard servlets and JSP 23 © Onkar Deshpande
24.
Disadvantages of Struts
Less transparent With Struts applications, there is a lot more going on behind the scenes than with normal Java-based Web applications. As a result, Struts applications are: Harder to understand Harder to benchmark and optimize Rigid approach The flip side of the benefit that Struts encourages a consistent approach to MVC is that Struts makes it difficult (but by no means impossible) to use other approaches 24 © Onkar Deshpande
25.
25 Thank You
© Onkar Deshpande