• 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

Regarding Request

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

how to send a request from one context to another context by using jsp or servlet can you help me.


Thanking you.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you trying to actually share the request object between contexts or would a simple redirect do the trick for you?
 
santhosh kumar vk
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sharing request object how to send from one context to another context
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without single container its not possible but you can use request parameter in URL to getting do.
reply
    Bookmark Topic Watch Topic
  • New Topic