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

override service method

 
Ashish Hiriadka
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am new to the servlet. I see in the Servlet code mentioned (in another topic), service method is overriden instead of overriding doGet or doPost. can we do this? if we can override, which HTTP method we should use in jsp?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Paul Clapham wrote:That's a bad practice. You should override doGet if your HTML code uses the GET method to request the servlet, and you should override doPost if your HTML code uses the POST method.


[Bear: sorry Paul, I split this incorrectly]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
    Bookmark Topic Watch Topic
  • New Topic