• 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

How to send values from one Servlet Context to other

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heyy Can any one tell me that How can I send values from one servletContext to other?.
Regards,
Vasantha
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
not directly, and for good reasons (mainly security).
There's several indirect ways:
- write a file with the data and check in the other application whether the file is there, if so read and delete.
- send HTTP requests back and forth
- use some other means of network communication
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To switch between web application contexts (in the same container) you need to call getcontext()method of servletcontext. That is -
getServletContext().getContext("\app2").
[ March 22, 2004: Message edited by: Varun Khanna ]
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In a security conscious environment, the servlet container may return null for a given URL.


Not guaranteed to work, and in fact I'd recommend any servlet container disabling it by default as it is a potential serious security problem.
 
reply
    Bookmark Topic Watch Topic
  • New Topic