wood burning stoves 2.0*
The moose likes Servlets and the fly likes getContext() returning null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getContext() returning null" Watch "getContext() returning null" New topic
Author

getContext() returning null

Nikhil Sagar
Ranch Hand

Joined: Apr 21, 2012
Posts: 216

Here is My code..


here on this line....
i am getting NullPointerException
first_app is deployed and running and working fine.
I am a newbie to serblets so please explain your answer properly.
Thanks in advance.


OCPJP 6 86%
Anirudh Srivastav
Greenhorn

Joined: Jun 30, 2012
Posts: 13
Nikhil,

Hope this helps you!

http://www.coderanch.com/t/359528/Servlets/java/ServletContext-getContext-method


Anirudh
PMP, OCJCP 6
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

otherCtx is null?

did you tune crossContext attribute in Context xml?
*Note:Some of the server may not support this function.
Ning Si Liu
Greenhorn

Joined: Jul 27, 2012
Posts: 2
Anirudh's link is good.
Sorry,I'm new here.I just want a post to test my account.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to JavaRanch Ning Si Liu !
Ning Si Liu
Greenhorn

Joined: Jul 27, 2012
Posts: 2
Seetharaman Venkatasamy wrote:Welcome to JavaRanch Ning Si Liu !

Thanks so much.I didn't plan to be gotten noticed.
Nikhil Sagar
Ranch Hand

Joined: Apr 21, 2012
Posts: 216

Seetharaman Venkatasamy wrote:otherCtx is null?

did you tune crossContext attribute in Context xml?
*Note:Some of the server may not support this function.


Unable to locate Context xml please tell me where is it??
i am using GlassFish Server Open Source Edition 3.1.2 (build 23)
Anirudh Srivastav
Greenhorn

Joined: Jun 30, 2012
Posts: 13
I guess you would have figured it out by yourself in case haven't here is a piece of info which would help you.

There is property named crossContextAllowed which is equivalent to crossContext of tomcat. It should be available in your web application's web app xml. You may refer your server user guide to know the exact syntax.

Hope this helps.

Regards
Anirudh Srivastav
Greenhorn

Joined: Jun 30, 2012
Posts: 13
Ning,

You are welcome. Enjoy your Java Ranch journey !!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getContext() returning null