aspose file tools*
The moose likes Servlets and the fly likes Confusion on doGet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Confusion on doGet" Watch "Confusion on doGet" New topic
Author

Confusion on doGet

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
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.


Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Are you missing something?


Rahul Bhattacharjee
LinkedIn - Blog
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
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

Joined: Nov 29, 2005
Posts: 2308
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

There is no doGet ??


[My Blog]
All roads lead to JavaRanch
prabakaran perumal
Greenhorn

Joined: Jan 24, 2007
Posts: 27
Hi Ragul

Please post the code
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
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 ]

From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
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

Joined: Apr 04, 2006
Posts: 213
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confusion on doGet