aspose file tools*
The moose likes Servlets and the fly likes Servlet Config and Servlet Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Config and Servlet Context" Watch "Servlet Config and Servlet Context" New topic
Author

Servlet Config and Servlet Context

Shahir Deo
Ranch Hand

Joined: Mar 19, 2013
Posts: 69

If we have 10 Servlets then how many Servlet Config and Servlet Context should i have? Asked in Interview to my frnd


Knowledge enlivens the soul.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
What was his answer? What do you think the answer is?


Ping & DNS - updated with new look and Ping home screen widget
Shahir Deo
Ranch Hand

Joined: Mar 19, 2013
Posts: 69

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

Joined: Jan 10, 2002
Posts: 60050
    
  65

You mean "right". What do you think? Why do you think he was right or wrong?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Shahir Deo
Ranch Hand

Joined: Mar 19, 2013
Posts: 69

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

Joined: Jan 10, 2002
Posts: 60050
    
  65

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

Joined: Mar 19, 2013
Posts: 69

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

Joined: Jun 08, 2010
Posts: 383

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.


http://plainoldjavaobject.blogspot.in
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Config and Servlet Context
 
Similar Threads
Servlet context and config
servlet context vs servlet config
Why sometimes servlets have got .do extension (why this)
init parameter.
Servlets