• 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

Getting request dispatcher object

 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RequestDispatcher rd = request.getRequestDispatcher("result.jsp");
RequestDipatcher rd = getServletContext.getRequestDispatcher("result.jsp");

There are two ways of getting the Request Dispatcher ? Whats the relation between the two ?
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no relation between this method from two different interfaces. It is just that in case of SetvletContext.getRequestDispature method(url), url must be relative to the root of your web application while this can be or not can be true with ServletRequest.getRequestDispature method(url) method.
 
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can the request dispatcher obtained from the context point to a different application... i mean to a different application?
 
Brij Garg
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Can the request dispatcher obtained from the context point to a different application... i mean to a different application?



I dont think so. Because every application has its own context. RequestDispature which is obtained, can forward or include resources within that context only.
 
reply
    Bookmark Topic Watch Topic
  • New Topic