Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting request dispatcher object

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • 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 ?
 
Brij Garg
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • 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.
 
James Tharakan
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic