• 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

Please clraify this...

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all ,
I am really confused with this ..


SRV1.7.3
if a servlet uses the RequestDispatcher to call a servlet in another web application....



Can u call a servlet in one web application through a servlet in another web application(as far as i know only include and forward can be done with RequestDispatcher ).Isnt this is the job of sendRedirect method of HttpServletResponse?

I have also gone through this topic please have a look at it
reffeerd thread

please clarify this doubt .

regards

-santosh
[ April 21, 2006: Message edited by: singh santosh ]
 
singh santosh
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ranchers,
is this question too stupid to be answered .I was expecting a answer for this Q but nobody has shown the interest in it.

Please give some answer to my doubt.

reagrds
-santosh
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Santosh,

This question is not realy stupid. You can dispatch the request to another resource in another context, but I think there are limitations. I have not tested but there is a method in the ServletContext interface named getContext, which takes the String argument uri path of the another context. It returns a ServletContext object that corresponds to a specified URL on the server.

Once you get ServletContext of another application, you can call its requestDispatcher method.

Read the following quotes from the API document about this method.

This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.

In a security conscious environment, the servlet container may return null for a given URL.



Hope this help ypu.

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

Lots of thanks for ur reply .Now its really clear...

I hope u will be there to clear my future doubts

regards

-santosh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic