Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

instantiating a servlet from another servlet

 
Ulvi Cetin
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method in a servlet and want to invoke it form another. Any ideas how can this be done?

Thx.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That way lies grief. It'd be best to factor the common code out of the first servlet so that it can be more easily reused across multiple servlets. Probably the best way to do this would be to create an abstract servlet class containing the common code that both your servlets could extend.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic