The basic convention in servlets extending HttpServlet is define one of the methods doGet or doPost (in case both happen to have the same processing logic) and call the other from inside the container called one.for eg:
class myservlet extends HttpServlet{
public void doGet(HttpRequest req,HttpResponse resp){
lots of code
}
public void doPost(HttpRequest req,HttpResponse resp){
doGet( req,resp);
}
}
Thats the above convention.My question is which is advantageous?
Defining code inside doPost and calling doPost from doGet request or defining code inside doGet and calling doGet from doPost ?
and Why?
is there any thumb of rule or justification for it?