Hii there,
I hope you can help me out here.
I have two webapps in my tomcat that is app1 and app2
in my app1 i am doing this

ServletContext sc=getServletContext().getContext("/app2");

But the above statement is returning me null.

I am stuck here where i am unable to figure out where instead of specifying "/app2" i should give the whole path like
"D:/program files/Tomcat/webapps/app2"

can you help me out with this

Recommended Answers

All 2 Replies

what is your root pointing too check tomcat config file? is it pointing to D:/program files/Tomcat/webapps?

inter-application communication is NOT allowed and hasn't been for quite some time.

The method you're trying to use is deprecated and has been changed several years ago to indeed return null.
It used to prevent a MAJOR security problem and was for that reason disabled.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.