This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
But to obtain the ServletContext Object you need a servlet and further it can be passed to any Class as method parameter and can be used.
Hope this helps. If you are trying to pass it to remote Object remember that it will be Pass by Value also I am not sure if ServletContext is serialized or not.
Goutham Pallipati wrote:
But to obtain the ServletContext Object you need a servlet ...
Not true.
The methods of the listener interfaces provided by the servlet spec all take an argument that contains everything you would need to gain access to the resources in the application.