wood burning stoves 2.0*
The moose likes Servlets and the fly likes which class has implementation of getSession() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "which class has implementation of getSession() method" Watch "which class has implementation of getSession() method" New topic
Author

which class has implementation of getSession() method

Satyen Singh
Greenhorn

Joined: Oct 05, 2011
Posts: 21

Hello freinds,

I am little confused about the various methods implementations.
Actually, I was Learning Servlet and JSP and I found many methods like

request.getSession();
response.getWriter();

and many more............

so please, can any one tell me where(In which class) the implementation of methods(getSession(), getWriter(), etc) are present ?

Thanks in advance, freinds.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Some class that implements the HttpServletRequest or ServletResponse interface, respectively. Which class that is depends on the servlet container you're using; it doesn't make a difference to the servlet developer.
Satyen Singh
Greenhorn

Joined: Oct 05, 2011
Posts: 21

Hey Tim,

What is the name of those Classes???
Does Container creates its own class???
when does those classes get loaded to execute the function definition ???

please reply,
Thanks Tim.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
The servlet container is responsible for providing the implementation of those classes. They are loaded/executed at appropriate times in the life cycle of the servlet.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60738
    
  65

Satyen Singh wrote:\What is the name of those Classes???

As already pointed out, it doesn't matter. Each container provides its own implementation of the interfaces.

Does Container creates its own class???

Yes, as stated above.

when does those classes get loaded to execute the function definition ???

That's up to the container. But obviously before they are needed.

Also note that in English, interrogative sentences end with a single question mark. Not three, and not five.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Satyen Singh
Greenhorn

Joined: Oct 05, 2011
Posts: 21

Thanks Bear,

Also I will take your advice of Interrogative Sentences Seriously.

Thanks once again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which class has implementation of getSession() method
 
Similar Threads
doubt about mock exam
Is this possible
Having doubt in mock exam question
Object "Savvy"
How to manage sessions in servlet ?