• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Handlers

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Explain the function of handlers in a web application
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Handlers" are also called "Action" classes. They are used in web applications that employ a "model 2" (also called model-view-controller, MVC) design pattern.
A "model 2" web app has what's called a controller servlet whose sole responsibilty to receive http requests from web browsers, determine what the end-user wants to do, determine which class is designed to execute the user's request, and calls a method on that class to handle that action.
My impression is that the term "Handler" is what developers called these classes in the pre-internet client-server days. They are now called "Actions".
Simon Brown has an excellent chapter in his book "Servlets 2.3" about designing web applications and you can download it for free on his web site http://www.simongbrown.com.
 
RJ Joshi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ..I would like to know how the handler class and dispatcher class interact ?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically, the dispatcher sets up the request with any information the handler will need and then (typically) uses a RequestDispatcher to forward the request to the handler. Then the dispatcher is no longer involved, the handler completes the response.
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic