Following is the code for LoginServlet. Assuming that it is not preloaded or preinitialized, which of the given statements about it are correct?
(Statements given below are regarding the methods defined in this class.)
//[code]
public class LoginServlet extends HttpServlet
{
public void init()
{
//initialize db.
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
{
//do something
}
public void doPost(HttpServletRequest req, HttpServletResponse res)
{
//do something
}
}
//[code]
1) For any HTTP request, at the most 2 of its methods will be called
2) For any and every request, atleast 1 of its methods will be called
3) for any and every request init() will be called
4) init() may be called more than once for an instance of this
servlet 5) it'll throw an exception at runtime if an HTTP DELETE request is sent to it.
What would be the answer ?