wood burning stoves 2.0*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Http method" Watch "Http method" New topic
Author

Http method

dolly shah
Ranch Hand

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

A.GET-answer
B.POST
C.HEAD
D.TRACE
E.PUT

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
Sheriff

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Http method