Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which class has implementation of getSession() method

 
Satyen Singh
Greenhorn
Posts: 21
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Satyen Singh
Greenhorn
Posts: 21
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,

Also I will take your advice of Interrogative Sentences Seriously.

Thanks once again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic