• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Implementing both doGet() and doPost()

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going through the Head First book for SCWCD and encountered the following : Chap-4 Page 118

"It says if a developer wants to support both the methods usually put logic in doPost(), then delegate to a doGet() if this request doesn't need to do post things:"

Not sure if I understand it..in my experience what I have seen is that if required we implement both doGet() and doPost() separately.

It would be helpful if somebody could explain what the above means...

Thanks
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Abhishek khare wrote:"It says if a developer wants to support both the methods usually put logic in doPost(), then delegate to a doGet() if this request doesn't need to do post things:"


It simply means like this:



Abhishek khare wrote:in my experience what I have seen is that if required we implement both doGet() and doPost() separately.


Now, I'm not sure about this, I never seen such code which had a different request processing for different action, but we can set the error code, stating "GET/POST action is not supported" kind of server error in doGet() or doPost() method.
 
Abhishek khare
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok...got it..thanks
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic