Win a copy of Design for the Mind this week in the Design forum!
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic