File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How RequestDispature actually work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How RequestDispature actually work?" Watch "How RequestDispature actually work?" New topic
Author

How RequestDispature actually work?

Rushi Patel
Greenhorn

Joined: Sep 14, 2011
Posts: 17



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

Joined: Jan 10, 2002
Posts: 61764
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
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..!


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1027
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.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How RequestDispature actually work?