This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2 methods in the same request

 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where do we handle a request originated in a form like this:
<form action=http://127.0.0.1/index.html?action=doStuff method=post>
<input type=nome value=testeParam>
<input type=submit>
</form>
in doPost or doGet???
 
John Hembree
hired gun
Ranch Hand
Posts: 250
MS IE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leandro oliveira:
<form action=http://127.0.0.1/index.html?action=doStuff method=post>

Actually I don't think you'll use either since the action item is calling for an HTML file. HTML files are static and would not be able to process anything on the querystring or any form value because you're just displaying the index.html file itself.
[ May 02, 2003: Message edited by: John Hembree ]
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do you know that index.html is a static file??? have you seen my deployment descriptor???
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only one method is being called! POST. Now, you are passing information in the Post body and on the URL. Not the best way to handle this but, most containers will parse out both and make them available from getParameter.
In your servlet, the doPost method will be called unless of course your mapping is to a JSP then the _jspService method will be called
 
John Hembree
hired gun
Ranch Hand
Posts: 250
MS IE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leandro oliveira:
how do you know that index.html is a static file??? have you seen my deployment descriptor???

I had originally answered something like Carl's (only not as well) but then thought that since this was the certification forum that this might have been a trick question and changed my answer.
[ May 02, 2003: Message edited by: John Hembree ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic