• 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

Using Servlet as a Dispatcher

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi out there,
I'm using three Servlets in my webapp as Dispatcher. On each call these Servlets are getting a parameter which describes what the Servlet will have to do.



Till now the called methods are private Methods of the Servlets. Normally they call some methods of some sessionbeans and than do something with the returned data.
The problem is that the servlet gets longer and longer and that these methods arent good reusable from other servlets. So I want to move this methods to some workerclasses.
Now I'm not sure what is the best design for these workerclasses. Normally I would make the methods static in these workerclasses. But I dont know if this solution works well in a Servlet / Sessionbean - Environment.
What do you think of this?? Are there any Design-Patterns for this?

Bye

Mark
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Research the Front Controller pattern.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic