Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion on doGet

 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends ,

I was giving mock exams on the net and i got confused on a small question...

there was a simple jsp which had a form whose action attribute was pointing to a servlet and its method was get...

So according to what i have learnt , it would go to the servlet and find corresponding doGet implementation and execute the code within it.. However , instead of doGet , there was a doPost() and still it executed it... Why this happened i was not able to recollect.


Please help me.

Thanks and Regards ,

Yogendra N Joshi.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you missing something?
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Rahul...

I dont think so..

I tried executive the same on my machine and thats what happened.. So i am quite confused

Please help.

Thanks.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the method of the form is GET then doGet will only get executed.

Are you calling doPost from within doGet ?
Check for one more thing , request.getMethod() and check what it returns.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no doGet ??
 
prabakaran perumal
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ragul

Please post the code
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by prabakaran perumal:
Hi Ragul

Please post the code


Joshi is this thread-starter, he should post the code...

if not, no one will understand the real problem.

Rahul is not this thread starter...

by the way, Joshi, you really should put your code here, so that we can easily answer your question....

you see you left the question with no piece of code, everyone here is just "guessing" the appropriate answer for you.

[ July 04, 2007: Message edited by: Nicky Eng ]
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes satou ,

You and rahul are right. There is no doGet. It got resolved. I had forgotten to reload the Application from tomcat manager.

Now it properly gives error saying http method GET is not supported by this URL. Now i am happy. :-)

Thanks to you and Rahul.

Cheers .
Yogendra
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry Nicky Eng for not posting the code in the first place.

I would surely be careful from next time to give the code as well so that it becomes easy for the Ranchers to help.

Thanks Once again to all those who helped me.

Regards ,

Yogendra
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic