Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Config and Servlet Context

 
Shahir Deo
Ranch Hand
Posts: 80
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we have 10 Servlets then how many Servlet Config and Servlet Context should i have? Asked in Interview to my frnd
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What was his answer? What do you think the answer is?
 
Shahir Deo
Ranch Hand
Posts: 80
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:What was his answer? What do you think the answer is?


He said " 1 Servlet Context and 10 Servlet Config."

Is this rite?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean "right". What do you think? Why do you think he was right or wrong?
 
Shahir Deo
Ranch Hand
Posts: 80
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You mean "right". What do you think? Why do you think he was right or wrong?

Just want to ensure , if it is wrong so we can rectify it !
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You still haven't answered the question. Do you think he was right? If you don't know, then this is good opportunity to look into the Servlet Spec and find out for sure.
 
Shahir Deo
Ranch Hand
Posts: 80
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You still haven't answered the question. Do you think he was right? If you don't know, then this is good opportunity to look into the Servlet Spec and find out for sure.


Yes , It is Right , because One ServletConfig per servlet and One ServletContext per JVM ..

So ?
 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shahir Deo wrote:

Yes , It is Right , because One ServletConfig per servlet and One ServletContext per JVM ..

So ?


"There is one context per "web application" per Java Virtual Machine."
"and one config per servlet"

cheers for you looked into the servlet specs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic