Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 1. Model 2 Applications > Model 2 with A Filter Dispatcher

Model 2 with A Filter Dispatcher

While a servlet is the most common controller in a Model 2 application, a filter can act as a controller too. As a matter of fact, filters have life cycle methods similar to those of servlets. These are life cycle methods of a filter.

  • init. Called once by the web container just before the filter is put into service.

  • doFilter. Called by the web container each time it receives a request with a URL that matches the filter’s URL pattern.

  • destroy. Called by the web container before the filter is taken out of service, i.e. when the application is shut down.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint