Hello ranchers, I was justing going thru the API. I found that the GenericServlet Abstract class has a method for getParameter(String). I just want to know, that when we write request.getParameter(String), does the container call the method from GenericServlet. I am preety confused, because int the doGet(HttpServletRequest, HttpServletResponse), both these are Interfaces, so where is the implementation. ???, I just trying the figure out, how the whole thing works!!, can anyone put some light on it....thanks in advance... Shashank
Hi Shashank javax.servlet.GenericServlet does not have any function with signature getParameter(String). Although it has one function with signature getInitParameter(java.lang.String name). This function is used to get the init parameter of servlet config. Servlet config parameters are defined in deployment descriptor.
When a browser sends the request to a servler the container creates two Object implementing javax.servlet.http.HttpServletRequest and javax.servlet.http.HttpServetRespose , creates a new thread and calles the service method of servlet passing these parameters.
but we get config values from servletConfig.getInitParameter(java.lang.String name). So the method getInitParameter(java.lang.String name) is called from the servletConfig interface. Then why does Generic Servlet has this method. Am i thinking in right direction??