Clicking an anchor and submitting a form are two different things. – Sotirios Delimanolis
Until that comment becomes an answer, here we go...
This also explains the 405 error. Clicking on a link performs a "get" request. Therefore doGet
is called, not doPost
. This form needs a "submit" button or a JavaScript callback which submits the form to the web server.