aspose file tools*
The moose likes Servlets and the fly likes Regarding Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Regarding Request" Watch "Regarding Request" New topic
Author

Regarding Request

santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 144
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: 144
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding Request
 
Similar Threads
Working with JSP & Servlet paths
Calling a method in object outside of your scope
JSP tags (JSTL) and request Attributes
Servlet css file location
Response attribute?