File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to send values from one Servlet Context to other Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to send values from one Servlet Context to other" Watch "How to send values from one Servlet Context to other" New topic
Author

How to send values from one Servlet Context to other

Vasantha Prabha
Ranch Hand

Joined: Oct 02, 2003
Posts: 108
Heyy Can any one tell me that How can I send values from one servletContext to other?.
Regards,
Vasantha


Regards,Vasantha<p>Great minds discuss ideas. Average minds discuss events. Small minds discuss people.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
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


42
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
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 ]

- Varun
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
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.
 
Consider Paul's rocket mass heater.
 
subject: How to send values from one Servlet Context to other
 
Similar Threads
Skip form validation but update backing bean values
Passing data from one server to another in a secured manner
use of hidden fields
crating a table using JSP
How to return data from a database table using Apache CXF web service?