Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

instantiating a servlet from another servlet  RSS feed

 
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
Posts: 66182
146
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!