• Post Reply Bookmark Topic Watch Topic
  • New Topic

about protected void doGet() ?

 
hasan khan
Ranch Hand
Posts: 223
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have created an HttpServlet which overrides

protected void doGet()

since this method is protected how to container calls this method?
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container never calls the doXXX methods. Instead the container always calls the public void service(ServletRequest req, ServletResponse res) method in HttpServlet class. This service method inturn calls the protected void service(HttpServletRequest req, HttpServletResponse resp) method.

This protected service method, then delegate the calls to doXXX methods as required.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!