Hi All Any body tell me that. we have 2 init() methods in GenericServlet right? can you tell me the difference between these 2 init() methods.
Thanks & Regards
Matteo Di Furia
posted 7 years ago
If you read the JavaDoc of GenericServlet, you'll find that the container will call init(ServletConfig). For convenience sake, the method init() will be called by init(config) and you only need to override init() to do what you have, so you don't have to worry about getting a ServletConfig object somewhere. As you can also read in init() JavaDoc, calling getServletConfig() will return a ServletConfig even if you've overridden init() method only.