• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getServletContext() : doubt

 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt about this code.Please check the code first.




jsp page is converted to servlet, and the container generated servlet uses a class that implements three interfaces,Servlet,JspPage and HttpJspPage. But these interfaces does not contain any method like getServletContext(). May be this method is available in org.apache.jasper.runtime.HttpJspBase class.

My doubt is
1) why any these three interfaces does not have getServletContext() method like GenericServlet has.

2) What the role of service method of Servlet in JSP.?

Please tell me how the container calls _jspService method.(step by step process) i mean which method of which class will call first and so on...
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For one thing, these would definitely not be there on the exam...The most important thing is you do not have the API docs for these runtime classes as you have for javax.http.* etc. ....why do you want to dig it?

However, for the second query, as mentioned in HFSJ, you can think it of as the servlet superclass' overridden service() method calling _jspService()...that's it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic