This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to send values from one Servlet Context to other

 
Vasantha Prabha
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heyy Can any one tell me that How can I send values from one servletContext to other?.
Regards,
Vasantha
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Varun Khanna
Ranch Hand
Posts: 1400
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic