Meta tags:
author= Dinesh Rajput;
Headings (most frequently used words):
servlet, class, httpservlet, api, the, example, life, cycle, cookie, hello, world, in, interface, what, is, web, application, upload, file, methods, of, share, this, related, posts, about, author, dinesh, rajput,
Text of the page (most frequently used words):
the (68), spring (53), and (35), tutorial (25), request (23), #servlet (21), interview (20), java (18), web (17), class (17), httpservlet (15), protected (13), httpservletrequest (13), http (13), void (12), httpservletresponse (11), boot (10), example (10), method (10), req (10), response (9), get (9), res (9), service (8), microservices (8), design (8), core (8), genericservlet (8), dinesh (7), share (7), doget (7), handles (7), invoked (7), container (7), security (6), aop (6), jax (6), hibernate (6), opens (6), new (6), window (6), for (6), mvc (5), with (5), methods (5), dopost (5), post (5), requests (5), api (4), cloud (4), soap (4), rest (4), patterns (4), batch (4), application (4), has (4), related (4), you (4), override (4), type (4), calls (4), jdbc (3), struts (3), services (3), tutorials (3), hateoas (3), development (3), architecture (3), technologies (3), more (3), than (3), was (3), previous (3), about (3), write (3), life (3), this (3), public (3), extends (3), throws (3), servletexception (3), ioexception (3), one (3), delete (3), put (3), privacy (2), policy (2), who (2), training (2), linux (2), git (2), thymeleaf (2), mongo (2), ant (2), gradle (2), maven (2), build (2), tools (2), ajax (2), hadoop (2), mail (2), jstl (2), jsp (2), j2ee (2), computing (2), wsdl (2), questions (2), search (2), mobile (2), certification (2), monitoring (2), testing (2), react (2), learn (2), solve (2), common (2), problems (2), use (2), rajput (2), technical (2), since (2), author (2), pattern (2), different (2), his (2), latest (2), framework (2), company (2), developer (2), when (2), file (2), what (2), interface (2), cycle (2), posts (2), pinterest (2), telegram (2), whatsapp (2), linkedin (2), facebook (2), next (2), using (2), servletcontext (2), servletconfig (2), servlets (2), difference (2), between (2), work (2), simplehttpservlet (2), getwriter (2), both (2), from (2), here (2), html (2), body (2), only (2), extend (2), dodelete (2), dotrace (2), doput (2), head (2), dohead (2), receives (2), dispatches (2), abstract (2), that (2), specific (2), determines (2), subclass (2), etc (2), copyright, 2026, hands, performance, engineer, guide, continuous, let, full, stack, designing, applications, native, various, them, best, practices, chief, editor, website, dineshonjava, blog, dedicated, series, articles, been, enthusiast, 2008, pivotal, certified, professional, book, blogger, years, experience, aspects, expertise, lies, version, creating, apis, microservice, reactive, cassandra, mongodb, currently, working, technology, manager, leading, product, worked, tech, lead, bennett, coleman, ltd, first, paytm, passionate, loves, blogs, very, active, member, community, forums, comes, tops, list, upload, hello, world, cookie, uploading, database, access, sevlet, filter, requestdispatcher, advantages, over, cgi, overview, index, would, recommend, instead, whenever, possible, easier, convenience, want, handle, given, can, have, call, other, how, respond, will, returns, time, last, modified, midnight, january, 1970, gmt, long, getlastmodified, trace, options, dooptions, doxxx, depending, incoming, converting, object, into, servletrequest, servletresponse, not, case, there, hardly, any, need, default, contains, capability, deciding, based, needful, then, nethod, find, subsequently, serve, webservice, popular, getservletinfo, used, provide, information, itself, init, destroy, managing, resources, during, similar, also, make, like, must, following, implements, serializable, provides, such, javax, slightly, advanced, base, reads, corresponding, comments, december, 2013, home,
Text of the page (random words):
class httpservlet dinesh on java core java core java java 8 certification interview q a spring boot spring spring core spring aop spring mvc spring security microservices spring 4 spring 5 spring batch spring mobile spring hateoas hibernate hibernate search tutorials design patterns web services ws interview questions jax ws soap jax rs rest wsdl soap cloud computing struts 2 tutorial j2ee tutorial servlet tutorial jsp tutorial jstl tutorial jdbc tutorial jax b tutorial java mail api hadoop tutorial ajax tutorial build tools maven gradle ant mongo db thymeleaf git linux interview q a spring interview aop interview mvc interview spring boot interview microservices interview spring security interview web service interview training who i am privacy policy home servlet class httpservlet december 11 2013 no comments class httpservlet the httpservlet class extends the genericservlet class and implements serializable interface it provides http specific methods such as doget dopost dohead dotrace etc the javax servlet http httpservlet class is a slightly more advanced base class than the genericservlet the httpservlet class reads the http request and determines if the request is an http get post put delete head etc and calls one the corresponding method similar to the genericservlet class this class is also abstract and we extend it make the subclass work like a servlet the subclass must override one of the following methods doget for http get requests dopost for http post requests dodelete for http delete requests doput for http put requests init destroy for managing the resources during the life of the servlet getservletinfo this method is used by the servlet to provide information about itself popular tutorials spring tutorial spring mvc web tutorial spring boot tutorial spring security tutorial spring aop tutorial spring jdbc tutorial spring hateoas microservices with spring boot rest webservice core java hibernate tutorial spring batch service method of httpservlet class is not abstract as was the case in the genericservlet class and there is hardly any need to override that method as by default it contains the capability of deciding the type of the http request it receives and based on that it calls the specific method to do the needful for example if an http get request calls the servlet then the service nethod of the httpservlet class determines the request type it ll find it to be get and subsequently calls doget method to serve the request methods of httpservlet class public void service servletrequest req servletresponse res dispatches the request to the protected service method by converting the request and response object into http type protected void service httpservletrequest req httpservletresponse res receives the request from the service method and dispatches the request to the doxxx method depending on the incoming http request type protected void doget httpservletrequest req httpservletresponse res handles the get request it is invoked by the web container protected void dopost httpservletrequest req httpservletresponse res handles the post request it is invoked by the web container protected void dohead httpservletrequest req httpservletresponse res handles the head request it is invoked by the web container protected void dooptions httpservletrequest req httpservletresponse res handles the options request it is invoked by the web container protected void doput httpservletrequest req httpservletresponse res handles the put request it is invoked by the web container protected void dotrace httpservletrequest req httpservletresponse res handles the trace request it is invoked by the web container protected void dodelete httpservletrequest req httpservletresponse res handles the delete request it is invoked by the web container protected long getlastmodified httpservletrequest req returns the time when httpservletrequest was last modified since midnight january 1 1970 gmt to respond to e g http get requests only you will extend the httpservlet class and override the doget method only here is an example public class simplehttpservlet extends httpservlet protected void doget httpservletrequest request httpservletresponse response throws servletexception ioexception response getwriter write html body get response body html if you want to handle both get and post request from a given servlet you can override both methods and have one call the other here is how public class simplehttpservlet extends httpservlet protected void doget httpservletrequest request httpservletresponse response throws servletexception ioexception dopost request response protected void dopost httpservletrequest request httpservletresponse response throws servletexception ioexception response getwriter write get post response i would recommend you to use the httpservlet instead of the genericservlet whenever possible httpservlet is easier to work with and has more convenience methods than genericservlet previous index next servlet related posts java servlets overview servlet life cycle servlet example difference between servletconfig and servletcontext difference between genericservlet and httpservlet what is web application advantages of servlets over cgi genericservlet example requestdispatcher example servletconfig servletcontext servlet filter example database access example using sevlet file uploading example using servlet previous next share this share on facebook opens in new window facebook share on x opens in new window x share on linkedin opens in new window linkedin share on whatsapp opens in new window whatsapp share on telegram opens in new window telegram share on pinterest opens in new window pinterest servlet related posts servlet api servlet life cycle the servlet cookie api hello world example in servlet interface what is web application servlet servlet upload file example about the author dinesh rajput dinesh rajput is the chief editor of a website dineshonjava a technical blog dedicated to the spring and java technologies it has a series of articles related to java technologies dinesh has been a spring enthusiast since 2008 and is a pivotal certified spring professional an author of a book spring 5 design pattern and a blogger he has more than 10 years of experience with different aspects of spring and java design and development his core expertise lies in the latest version of spring framework spring boot spring security creating rest apis microservice architecture reactive pattern spring aop design patterns struts hibernate web services spring batch cassandra mongodb and web application design and architecture he is currently working as a technology manager at a leading product and web development company he worked as a developer and tech lead at the bennett coleman co ltd and was the first developer in his previous company paytm dinesh is passionate about the latest java technologies and loves to write technical blogs related to it he is a very active member of the java and spring community on different forums when it comes to the spring framework and java dinesh tops the list learn various design patterns and best practices and use them to solve common design problems learn spring boot 2 0 and spring cloud application microservices architecture to solve common cloud native problems designing applications with spring boot 2 2 and react js let us full stack development with spring boot and react js hands on microservices monitoring and testing a performance engineer s guide to the continuous testing and monitoring of microservices dinesh on java copyright 2026 core java core java java 8 certification interview q a spring boot spring spring core spring aop spring mvc spring security microservices spring 4 spring 5 spring batch spring mobile spring hateoas hibernate hibernate search tutorials design patterns web services ws interview questions jax ws soap jax rs rest wsdl soap cloud computing struts 2 tutorial j2ee tutorial servlet tutorial jsp tutorial jstl tutorial jdbc tutorial jax b tutorial java mail api hadoop tutorial ajax tutorial build tools maven gradle ant mongo db thymeleaf git linux interview q a spring interview aop interview mvc interview spring boot interview microservices interview spring security interview web service interview training who i am privacy policy
|