• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confusion on doGet

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you missing something?
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no doGet ??
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ragul

Please post the code
 
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic