• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How RequestDispature actually work?

 
Rushi Patel
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



in this simple example RequestDispature is INTERFACE..! "red" is reference for that , but whose instance it actually holds ???
"forward" and "include" methods are of RequestDispature interface...but where they are implemented ??? in which class ?? which class implement this interface ???

Can anyone explain this code completely ???
From beginning ...as i am newbie in this technology...!
NO PROPER BACKGROUND PROCESS IS EXPLAINED IN ANY BOOK...!

--------------------------------------------------------------------------------

Another query
------------
HttpServletRequest is also an Interface whose Ref is "request" but in that whose object / instance is held ??? object of request from client ??? is it generated by container ? while getting an request for particular servlet?

Thanks in Advance..!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64716
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The interfaces are implemented by classes defined by the container. That's the beauty of interfaces -- each container can implement them however they like, and we don't have to care.
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean RequestDispatcher right? If so, there are tons of information out there. Bottom line - In the case of forward, you are asking the resource that is being forwarded to to handle the request.

Rushi Patel wrote:


in this simple example RequestDispature is INTERFACE..! "red" is reference for that , but whose instance it actually holds ???
"forward" and "include" methods are of RequestDispature interface...but where they are implemented ??? in which class ?? which class implement this interface ???

Can anyone explain this code completely ???
From beginning ...as i am newbie in this technology...!
NO PROPER BACKGROUND PROCESS IS EXPLAINED IN ANY BOOK...!

--------------------------------------------------------------------------------

Another query
------------
HttpServletRequest is also an Interface whose Ref is "request" but in that whose object / instance is held ??? object of request from client ??? is it generated by container ? while getting an request for particular servlet?

Thanks in Advance..!
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suggestions: Take a look at the Servlet specification.

If you really want source code, then Tomcat implements a JSP container, and you can get the source code for that directly.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic