| Author |
Regarding Request
|
santhosh kumar vk
Ranch Hand
Joined: Aug 25, 2009
Posts: 115
|
|
hi,
how to send a request from one context to another context by using jsp or servlet can you help me.
Thanking you.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
Are you trying to actually share the request object between contexts or would a simple redirect do the trick for you?
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
santhosh kumar vk
Ranch Hand
Joined: Aug 25, 2009
Posts: 115
|
|
|
I am sharing request object how to send from one context to another context
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Look at:
http://download.oracle.com/docs/cd/E17477_01/javaee/1.4/api/javax/servlet/ServletContext.html#getContext(java.lang.String) to get a handle to the other context.
Then look at http://download.oracle.com/docs/cd/E17477_01/javaee/1.4/api/javax/servlet/ServletContext.html#getRequestDispatcher(java.lang.String) which is used to forward request.
Note: The servlet spec (last I read it) is not very clear on all the specifics of cross context communication so the specific implementation details tend to vary from container to container. Also, what I've posted will not work if the two contexts are not in the same container on the same machine.
|
 |
Alpesh Padra
Ranch Hand
Joined: Jan 10, 2010
Posts: 41
|
|
|
Without single container its not possible but you can use request parameter in URL to getting do.
|
 |
 |
|
|
subject: Regarding Request
|
|
|