Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

RequestDispatcher

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any ony let me know the different ways of getting RequestDispatcher object in a servlet, and how actually they differ.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Request dispatcher is a interface.actually RequestDispatcher means to dispatch the incoming Http request to some other servlet or jsp page. this is a concept.but u can obtain it two ways.
throug ServletContext,HttpServletResponse.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
Ramakrishna is right. The methods used are:
You use either the getRequestDispatcher(relative path of resource)
or getRequestDispatcher(absolute path of resource)
or getnamedDispatcher(name of the resource)(Check the method name)
-Sri
 
Apan Raj
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per the API, there is no much difference between the methods in ServletContext and ServletRequest ( Ramakrishna, its not HttpServletResponse ), except that
the method in ServletContext accept only relative path where as the other method also accept absolute path.
 
You can't expect to wield supreme executive power just because
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic