Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Filter and Wrapper question

 
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,

1)
Its said that calling doFilter on FilterChain is not nessassary, suppose

F1--F2--F3--F4--Servlet

if F2 do not implement chain.doFilter() then does the Servlet will be called after F2 filter not by invoking F3 and F4?

2)
when you sub class a Wrapper is it necessary to override at least one wrapper method? i mean suppose we dont override getOutputStream() calling this wont give us a custom output stream right?

Thank You.

 
Harshana Dias
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if F2 do not writhe chain.doFilter() then is Servlet will be called after F2 filter not by invoking F3 and F4?


No, the request will stop in F2, so the servlet will not be invoked.

when you sub class a Wrapper is it necessary to override at least one wrapper method? i mean suppose we dont override getOutputStream() calling this wont give us a custom output stream right?


It's not necessary to override anything. If you don't, the default behaviour described in the API will occur.
 
Hug your destiny! And hug this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic