Suche senden
Hochladen
Struts Interceptors
•
2 gefällt mir
•
1,140 views
Onkar Deshpande
Folgen
Introduction to Struts Framework and Struts Interceptors
Weniger lesen
Mehr lesen
Software
Melden
Teilen
Melden
Teilen
1 von 25
Empfohlen
Struts2
Struts2
Rajiv Gupta
Introduction to Spring Framework
Introduction to Spring Framework
Serhat Can
Introduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
Spring boot
Spring boot
Bhagwat Kumar
Java 8 presentation
Java 8 presentation
Van Huong
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
shaunthomas999
Introduction to Struts 1.3
Introduction to Struts 1.3
Ilio Catallo
Spring Boot
Spring Boot
HongSeong Jeon
Empfohlen
Struts2
Struts2
Rajiv Gupta
Introduction to Spring Framework
Introduction to Spring Framework
Serhat Can
Introduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
Spring boot
Spring boot
Bhagwat Kumar
Java 8 presentation
Java 8 presentation
Van Huong
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
An Introduction to JUnit 5 and how to use it with Spring boot tests and Mockito
shaunthomas999
Introduction to Struts 1.3
Introduction to Struts 1.3
Ilio Catallo
Spring Boot
Spring Boot
HongSeong Jeon
Junit
Junit
FAROOK Samath
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.
David Gómez García
Java 8 - Features Overview
Java 8 - Features Overview
Sergii Stets
Spring boot
Spring boot
Gyanendra Yadav
Unit testing with JUnit
Unit testing with JUnit
Pokpitch Patcharadamrongkul
What is Dependency Injection in Spring Boot | Edureka
What is Dependency Injection in Spring Boot | Edureka
Edureka!
REST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
Introduction to the Web API
Introduction to the Web API
Brad Genereaux
JUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
Onkar Deshpande
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
Spring Framework - AOP
Spring Framework - AOP
Dzmitry Naskou
Struts
Struts
s4al_com
Spring Web MVC
Spring Web MVC
zeeshanhanif
Spring Framework - Core
Spring Framework - Core
Dzmitry Naskou
Spring Boot
Spring Boot
Jaran Flaath
Spring Framework
Spring Framework
tola99
Spring Core
Spring Core
Pushan Bhattacharya
Awskrug AWS SNS, SQS, and SES
Awskrug AWS SNS, SQS, and SES
JungHakLee4
TestNG Framework
TestNG Framework
Levon Apreyan
Spring boot
Spring boot
sdeeg
Struts Interview Questions
Struts Interview Questions
jbashask
Struts2
Struts2
shankar_b7
Weitere ähnliche Inhalte
Was ist angesagt?
Junit
Junit
FAROOK Samath
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.
David Gómez García
Java 8 - Features Overview
Java 8 - Features Overview
Sergii Stets
Spring boot
Spring boot
Gyanendra Yadav
Unit testing with JUnit
Unit testing with JUnit
Pokpitch Patcharadamrongkul
What is Dependency Injection in Spring Boot | Edureka
What is Dependency Injection in Spring Boot | Edureka
Edureka!
REST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
Introduction to the Web API
Introduction to the Web API
Brad Genereaux
JUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
Onkar Deshpande
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
Hitesh-Java
Spring Framework - AOP
Spring Framework - AOP
Dzmitry Naskou
Struts
Struts
s4al_com
Spring Web MVC
Spring Web MVC
zeeshanhanif
Spring Framework - Core
Spring Framework - Core
Dzmitry Naskou
Spring Boot
Spring Boot
Jaran Flaath
Spring Framework
Spring Framework
tola99
Spring Core
Spring Core
Pushan Bhattacharya
Awskrug AWS SNS, SQS, and SES
Awskrug AWS SNS, SQS, and SES
JungHakLee4
TestNG Framework
TestNG Framework
Levon Apreyan
Spring boot
Spring boot
sdeeg
Was ist angesagt?
(20)
Junit
Junit
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.
Java 8 - Features Overview
Java 8 - Features Overview
Spring boot
Spring boot
Unit testing with JUnit
Unit testing with JUnit
What is Dependency Injection in Spring Boot | Edureka
What is Dependency Injection in Spring Boot | Edureka
REST & RESTful Web Services
REST & RESTful Web Services
Introduction to the Web API
Introduction to the Web API
JUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
Spring Framework - AOP
Spring Framework - AOP
Struts
Struts
Spring Web MVC
Spring Web MVC
Spring Framework - Core
Spring Framework - Core
Spring Boot
Spring Boot
Spring Framework
Spring Framework
Spring Core
Spring Core
Awskrug AWS SNS, SQS, and SES
Awskrug AWS SNS, SQS, and SES
TestNG Framework
TestNG Framework
Spring boot
Spring boot
Ä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
01 Struts Intro
01 Struts Intro
sdileepec
Struts Into
Struts Into
Vijay subedar
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
01 Struts Intro
01 Struts Intro
Struts Into
Struts Into
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
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Jhone kinadey
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alberto González Trastoy
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
shikhaohhpro
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
Evangelist Apps https://twitter.com/EvangelistSW/
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ComplianceQuest1
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Steffen Staab
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
Cionsystems
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
Arshad QA
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Delhi Call girls
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
aagamshah0812
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
bodapatigopi8531
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
kellynguyen01
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
joe51371421
Clustering techniques data mining book ....
Clustering techniques data mining book ....
ShaimaaMohamedGalal
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
harshavardhanraghave
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
kalichargn70th171
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
SolGuruz
Kürzlich hochgeladen
(20)
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
Clustering techniques data mining book ....
Clustering techniques data mining book ....
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
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