Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Sudhakar Duraiswamy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2902
196
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont seem to understand y?

See this previous thread and search for crosscontext thread

Regards,
Frits
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!