Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Confusion on doGet

 
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.
 
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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no doGet ??
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ragul

Please post the code
 
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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic