File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Http 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 "Http method" Watch "Http method" New topic

Http method

dolly shah
Ranch Hand

Joined: Jun 18, 2007
Posts: 383
<form action=�/servlet/comment�>
<p>Please provide your comment here:</p>
<input type=�text� size=�40� name=�Comment�>
<input type=�submit� value=�Submit�>


Why the answer is "A"? Though in form action there is no method so default is GET, but from the input type='submit' isn't it call to POST method? Correct me if I am wrong.

SCJP-1.5<br />SCWCD-1.4
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

The submit button doesn't change the method type. If nothing is specified in the form tag, the method will be a GET.

A good workman is known by his tools.
dolly shah
Ranch Hand

Joined: Jun 18, 2007
Posts: 383
Thanks Marc. I got it now.
Urs Waefler
Ranch Hand

Joined: Mar 13, 2007
Posts: 77
There is a better explanation, it is simple.

If nothing is mentioned, it is GET. GET is the default value, that�s it.

SCJP 1.4
I agree. Here's the link:
subject: Http method
It's not a secret anymore!