wood burning stoves*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Fetching the cotext of the different application hosted within the same tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Fetching the cotext of the different application hosted within the same tomcat" Watch "Fetching the cotext of the different application hosted within the same tomcat" New topic
Author

Fetching the cotext of the different application hosted within the same tomcat

Sudhakar Duraiswamy
Ranch Hand

Joined: Dec 20, 2007
Posts: 43
Hi,
I trying to get hold of the ServletContext of another application deployed within the same tomcat .

api points that i should be able to by calling public ServletContext getContext(java.lang.String uripath) on current servlet context

so when i try printing this



Output:
Different Context null


I dont seem to understand y?


Other details:
container : tomcat 5.5
deployed as Dynamic Web project


Sudhakar
SCJP 5.0 93%| SCWCD (prep. ongoing))
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1661
    
  25

I dont seem to understand y?

See this previous thread and search for crosscontext thread

Regards,
Frits
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Sudhakar Duraiswamy wrote:


Output:
Different Context null


Did you check the API of the ServletContext? There,
In a security conscious environment, the servlet container may return null for a given URL.


So, it may be the reason!


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
jQuery in Action, 2nd edition
 
subject: Fetching the cotext of the different application hosted within the same tomcat