SlideShare a Scribd company logo
Chapter  13  
Filters  and  Wrappers
Intercepting	
  the	
  requests	
  &	
  responses
Filters
Provide	
  universal	
  functions	
  that	
  can	
  be	
  "attached"	
  to	
  any	
  type	
  of	
  servlet	
  
or	
  JSP	
  page.	
  
• Authentication	
  
• Logging	
  and	
  auditing	
  
• Image	
  conversion	
  
• Data	
  compression	
  
• Localization	
  
• XSL/T	
  transformations	
  of	
  XML	
  content
Filters  API
Filter,	
  FilterChain,	
  and	
  FilterConfig	
  interfaces	
  in	
  the	
  javax.servlet	
  
package.	
  	
  
• Define	
  a	
  filter	
  by	
  implementing	
  the	
  Filter	
  interface.	
  	
  
• A	
  filter	
  chain,	
  	
  
• passed	
  to	
  a	
  filter	
  by	
  the	
  container,	
  	
  
• provides	
  a	
  mechanism	
  for	
  invoking	
  a	
  series	
  of	
  filters.	
  
• FilterConfig	
  contains	
  initialization	
  data.
Filters
• Security	
  checks	
  
• Reformat	
  headers	
  and	
  
bodies	
  
• Audit/log
• Compress	
  	
  
• Append	
  
• Create	
  new
Modular  and  Reconfigurable  (in  DD)
Filters  are  just  like  servlets
• The	
  Container	
  knows	
  their	
  API	
  
• The	
  Container	
  manages	
  their	
  lifecycle	
  
• They	
  are	
  declared	
  in	
  DD
Request  
tracking  
filter
Stack
Declare  
and  
order

(in  DD)
Compression  
Filter

(version  1)
Compression  Filter

(conceptual  view)
API
Compression  Filter

(version  2)
Compression  Filter

(version  3)
Final  Code
Compression  Wrapper  –  helper  class
Examples
“Filter’s	
  Essential”	
  by	
  Oracle

More Related Content

PDF
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
PDF
Being a jsp
PDF
Ch5 beeing an application
PPTX
Advance java session 20
PPTX
Advance java session 15
PPT
MuleSoft ESB Object Store
PDF
MuleSoft ESB Shared Library
PPTX
MuleSoft ESB Scripting Example
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
Being a jsp
Ch5 beeing an application
Advance java session 20
Advance java session 15
MuleSoft ESB Object Store
MuleSoft ESB Shared Library
MuleSoft ESB Scripting Example

What's hot (20)

PDF
Jeetrainers.com coursejspservlets00
PDF
Servlet and JSP
PDF
Dynamic content generation
PPTX
Road Trip To Component
PPTX
MuleSoft ESB Payload Encrypt using Anypoint Security
PPT
MuleSoft ESB Routes first-successful
PPTX
MuleSoft ESB Filtering data instead of Looping
PPT
Deploying java beans in jsp
ODP
Servlets
PPTX
Servlet.ppt
PDF
Java Server Pages
PPTX
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
PDF
Building Web Applications with Zend Framework
PPT
Zend framework 02 - mvc
PPTX
MuleSoft ESB Composite Source
PPTX
Mule esb
PPTX
PPTX
Java Web services
Jeetrainers.com coursejspservlets00
Servlet and JSP
Dynamic content generation
Road Trip To Component
MuleSoft ESB Payload Encrypt using Anypoint Security
MuleSoft ESB Routes first-successful
MuleSoft ESB Filtering data instead of Looping
Deploying java beans in jsp
Servlets
Servlet.ppt
Java Server Pages
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
Building Web Applications with Zend Framework
Zend framework 02 - mvc
MuleSoft ESB Composite Source
Mule esb
Java Web services
Ad

Viewers also liked (11)

PDF
Ch. 11 deploying
PDF
Ch. 10 custom tag development
PDF
Ch. 9 jsp standard tag library
PDF
Ch. 12 security
PDF
Ch. x web performance
PDF
Ch6 conversational state
PDF
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
PDF
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
PDF
Ch. 8 script free pages
PDF
Ch. 7 beeing a jsp
PDF
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
Ch. 11 deploying
Ch. 10 custom tag development
Ch. 9 jsp standard tag library
Ch. 12 security
Ch. x web performance
Ch6 conversational state
1η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
2η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
Ch. 8 script free pages
Ch. 7 beeing a jsp
3η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
Ad

Similar to Ch. 13 filters and wrappers (20)

PPTX
Advance java session 17
PPTX
Filter
PPTX
Filter
PPTX
NiFi - First approach
PPTX
Apache Solr Workshop
PPT
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
PPTX
Java se7 features
PDF
.NET Core, ASP.NET Core Course, Session 9
PPTX
Akka.Net Overview
PDF
Arquiteturas usando Pipes and Filters
PDF
Sling Component Filters in CQ5
PDF
Introduction to firebidSQL 3.x
PPTX
Java 17 features and implementation.pptx
PPTX
Petro Gordiievych "From Java 9 to Java 12"
PPT
Distributed & Highly Available server applications in Java and Scala
PPTX
Microservices Part 4: Functional Reactive Programming
PPTX
Iterator - a powerful but underappreciated design pattern
PDF
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
PPTX
ColdFusion Fw1 (FrameWork1) introduction
PPT
Apachecon 2002 Struts
Advance java session 17
Filter
Filter
NiFi - First approach
Apache Solr Workshop
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
Java se7 features
.NET Core, ASP.NET Core Course, Session 9
Akka.Net Overview
Arquiteturas usando Pipes and Filters
Sling Component Filters in CQ5
Introduction to firebidSQL 3.x
Java 17 features and implementation.pptx
Petro Gordiievych "From Java 9 to Java 12"
Distributed & Highly Available server applications in Java and Scala
Microservices Part 4: Functional Reactive Programming
Iterator - a powerful but underappreciated design pattern
ASP.NET MVC_Routing_Authentication_Aurhorization.pdf
ColdFusion Fw1 (FrameWork1) introduction
Apachecon 2002 Struts

Recently uploaded (20)

PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Structure & Organelles in detailed.
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Cell Types and Its function , kingdom of life
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
master seminar digital applications in india
PDF
Pre independence Education in Inndia.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Business Ethics Teaching Materials for college
Week 4 Term 3 Study Techniques revisited.pptx
Pharma ospi slides which help in ospi learning
Cell Structure & Organelles in detailed.
human mycosis Human fungal infections are called human mycosis..pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Complications of Minimal Access Surgery at WLH
Supply Chain Operations Speaking Notes -ICLT Program
01-Introduction-to-Information-Management.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
102 student loan defaulters named and shamed – Is someone you know on the list?
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Cell Types and Its function , kingdom of life
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
master seminar digital applications in india
Pre independence Education in Inndia.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Business Ethics Teaching Materials for college

Ch. 13 filters and wrappers