jQuery in Action, 2nd edition*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 1627
    
  23

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%|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fetching the cotext of the different application hosted within the same tomcat
 
Similar Threads
InitialContext finds localhost on bound jboss [SOLVED]
servletContext()
j2ee certificate ques
sendRedirect Vs requestdispatcher.forward
Application deployed at two servers or containers