Expand|Select|Wrap|Line Numbers
- HashMap props = new HashMap();
- props.put(Context.INITIAL_CONTEXT_FACTORY,"FactoryClass");
- Context ctx = new InitialContext(props);
But when it is not given then what happens?
From where the context obtained?
Now in Web Application we define the resources in context.xml(for tomcat).
So to obtain a context we simply call the zero argument constructor and then simply by lookup service we get the resources bound to names. So here how the Context service provider obtained without setting the properties value.