Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

More than one servlet per web application

 
Rohit Seth
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we have more than one servlet instances running per web app. If yes then how would servletContext(application Context) be defined then ?
 
Ajay Saxena
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can certainly have multiple servlets in a single webapp. The servlet context is a web app level object that could be shared across all the servlets belonging to the web app.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic