aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes doPost method ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "doPost method ?" Watch "doPost method ?" New topic
Author

doPost method ?

Imran Vohra
Ranch Hand

Joined: Dec 12, 2005
Posts: 77

I came across one mock question.
In JSP below mentioned statement is given


In "MyServlet" Servlet, doGet() and doPost() method is defined.
Then answer is saying that it will call doGet() method.
Explanation is given like this:
doPost is invalid value, so it will interprets it as GET and will call doGet() method.
Is this right?
I had selected answer "Server reports an error"

Thanks
Imran
Amit Tayal
Ranch Hand

Joined: Apr 25, 2006
Posts: 51
I tried this case and doGet method is called.

Amit
Imran Vohra
Ranch Hand

Joined: Dec 12, 2005
Posts: 77

But, anybody clearify that is it vendor-specific or guaranteed by spec.

Thanks
Imran
Vikrant Pandit
Ranch Hand

Joined: Mar 27, 2006
Posts: 245
I doubt that can be guaranteed by Spec .

This totally depends on the browser in use


Vikrant Pandit
Mohd Fuzail
Ranch Hand

Joined: Feb 20, 2002
Posts: 107
doPost is invalid value, so it will interprets it as GET and will call doGet() method.
Is this right?


Yes, default mechanism for Form submission if through GET, hence goGet() is called.

In case if we want doPost() to be called then we need to specify it in FORM tag parameters


Being defeated is often a temporary condition. Giving up is what makes it permanent.
 
 
subject: doPost method ?