• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I dont seem to understand y?


See this previous thread and search for crosscontext thread

Regards,
Frits
 
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic