Win a copy of Svelte and Sapper in Action this week in the JavaScript 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

Servlet issue

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one servlet class file which contains the service() ,doGet() and doPost() methods . I have posted the Person details from JSP file for updation . I don't know which service method will be first invoke
can you tell me ?


Thanks in advance

Lakshman
 
Greenhorn
Posts: 1
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming is an HttpServlet, it will call service() then doPost() (assuming your FORM action = "POST").

According to the docs, service() "receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class... There's no need to override this method. "

Bob
 
Sheriff
Posts: 21999
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSPs are compiled into classes that extend HttpServlet, and being servlets it's the service method that is called. Unless you've overridden that method, it will call one of the doXXX methods, depending on the HTTP method of the request. If you've overridden the service method then it will only do what you've written inside it.
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Except in extraordinary circumstances you should not be overriding service().
 
Let's get him boys! We'll make him read this tiny ad!
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic