IntelliJ Java IDE
The moose likes Servlets and the fly likes which class has implementation of getSession() method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply 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: 2329
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: 1503
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 opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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.
 
IntelliJ Java IDE
 
subject: which class has implementation of getSession() method
 
Threads others viewed
doubt about mock exam
Is this possible
Object "Savvy"
How to manage sessions in servlet ?
Having doubt in mock exam question
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture