aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Method - POST Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Method - POST" Watch "Method - POST" New topic
Author

Method - POST

Ashu Jain
Ranch Hand

Joined: Feb 24, 2008
Posts: 73
Hanumant dekhmukh book says :: (Pg 36)

Q: Which method of TestServlet will be called when a user clicks on following URL?
<a href="/servlet/TestServlet" method="POST"> Test URL </a>

As method is "POST", I thought the answer would be doPost but answer is following in book:

- The method "POST" attribute-value pair does not make sense in the <a href> tag. Clicking on hyperlink always sends a GET request and thus the doGet() method will be called.

Can anyone explain - if method is specified...is it possible that doGet is still invoked.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

The method "POST" attribute-value pair does not make sense in the <a href> tag.

This says it all. If you check the HTML specification, you'll see that there's no such "method" attribute for the "a" tag. (It is a valid attribute with a "form" tag)


[My Blog]
All roads lead to JavaRanch
Ashu Jain
Ranch Hand

Joined: Feb 24, 2008
Posts: 73
Got it thanks.

I have not read HTML spec. Is it important for me to read HTML spec to pass SCWCD with good marks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

It's not that important, but for somebody who wants to become a web component developer, I think it is You should know at least the basics, like what forms and links are.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Method - POST