Meta tags:
author= Dinesh Rajput;
Headings (most frequently used words):
servlet, servletcontext, servlets, httprequest, parameters, headers, inputstream, session, api, difference, between, servletconfig, and, in, java, auto, page, refresh, filters, environment, setup, what, is, web, application, share, this, related, posts, about, the, author, dinesh, rajput,
Text of the page (most frequently used words):
the (92), spring (53), #request (41), and (26), tutorial (25), you (21), interview (20), http (20), java (19), servlet (17), object (17), parameters (16), web (14), httprequest (13), browser (12), servletcontext (11), boot (10), with (10), access (10), body (10), can (9), session (9), microservices (8), design (8), core (8), from (8), sent (8), dinesh (7), application (7), share (7), example (7), security (6), aop (6), jax (6), hibernate (6), opens (6), new (6), window (6), this (6), sends (6), string (6), are (6), part (6), mvc (5), soap (5), about (5), what (5), servlets (5), get (5), here (5), for (5), will (5), data (5), inputstream (5), post (5), headers (5), param1 (5), cloud (4), rest (4), patterns (4), batch (4), has (4), related (4), between (4), file (4), method (4), getparameter (4), header (4), content (4), length (4), service (3), api (3), jdbc (3), struts (3), services (3), tutorials (3), hateoas (3), development (3), architecture (3), technologies (3), previous (3), difference (3), servletconfig (3), httpservlet (3), have (3), how (3), too (3), contains (3), information (3), instance (3), any (3), that (3), like (3), name (3), null (3), used (3), query (3), url (3), doget (3), param2 (3), world (3), hello (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), dineshonjava (2), technical (2), author (2), pattern (2), different (2), his (2), latest (2), framework (2), company (2), developer (2), first (2), posts (2), pinterest (2), telegram (2), whatsapp (2), linkedin (2), facebook (2), next (2), using (2), genericservlet (2), context (2), getsession (2), meta (2), set (2), other (2), given (2), requests (2), during (2), read (2), same (2), obtain (2), engine (2), not (2), parse (2), just (2), raw (2), calling (2), bytes (2), general (2), exists (2), getheader (2), returned (2), code (2), along (2), lot (2), included (2), parameter (2), protected (2), void (2), httpservletrequest (2), httpservletresponse (2), response (2), throws (2), servletexception (2), ioexception (2), two (2), methods (2), javax (2), copyright, 2026, hands, performance, engineer, guide, continuous, let, full, stack, designing, applications, native, various, them, best, practices, chief, editor, website, blog, dedicated, series, articles, been, enthusiast, since, 2008, pivotal, certified, professional, book, blogger, more, than, years, experience, aspects, expertise, lies, version, creating, apis, microservice, reactive, cassandra, mongodb, currently, working, technology, manager, leading, product, worked, tech, lead, bennett, coleman, ltd, was, paytm, passionate, loves, write, blogs, very, active, member, community, forums, when, comes, tops, list, environment, setup, filters, auto, page, refresh, uploading, database, sevlet, filter, requestdispatcher, advantages, over, cgi, life, cycle, overview, index, see, getservletcontext, xml, forward, store, wide, httpsession, hold, user, into, one, available, subsequent, within, time, scope, possible, does, help, interprete, note, call, before, because, cause, once, parsed, cannot, stream, anymore, requestbodyinput, getinputstream, give, pointing, done, potential, server, doesn, could, pretty, much, passed, number, case, above, return, reads, contentlength, value, pairs, contain, software, being, types, capable, receiving, etc, short, around, would, were, these, notice, values, typically, https, com, somepage, html, webservice, popular, cover, most, commonly, purpose, represent, your, thus, anything, may, send, accessible, via, signature, httpresponse, class, processing, take, comments, december, 2013, home,
Text of the page (random words):
httprequest 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 httprequest december 12 2013 no comments httprequest the httpservlet class request processing methods take two parameters javax servlet http httprequest javax servlet http httpresponse for instance here is the signature of the httpservlet doget method protected void doget httpservletrequest request httpservletresponse response throws servletexception ioexception the purpose of the httprequest object is to represent the http request a browser sends to your web application thus anything the browser may send is accessible via the httprequest the httprequest object has a lot of methods so i will just cover the most commonly used here parameters headers inputstream session servletcontext 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 parameters the request parameters are parameters that are sent from the browser along with the request request parameters are typically sent as part of the url in the query string or as part of the body of an http request for instance https dineshonjava com somepage html param1 hello m2 world notice the query string part of the url param1 hello m2 world this part contains two parameters with parameter values param1 hello param2 world you can access these parameters from the httprequest object like this protected void doget httpservletrequest request httpservletresponse response throws servletexception ioexception string param1 request getparameter param1 string param2 request getparameter param2 you would use the same code if the request parameters were sent in the body part of the http request if no parameter exists with the given name null is returned in general if the browser sends an http get request the parameters are included in the query string in the url if the browser sends an http post request the parameters are included in the body part of the http request headers the request headers are name value pairs sent by the browser along with the http request the request headers contain information about e g what browser software is being used what file types the browser is capable of receiving etc in short at lot of meta data around the http request you can access the request headers from the httprequest object like this string contentlength request getheader content length this example reads the content length header sent by the browser the content length header contains the number of bytes sent in the http request body in case the browser sends an http post request if the browser sends an http get request the content length header is not used and the above code will return null in general if no header exists with the name passed to getheader null is returned inputstream if the browser sends an http post request request parameters and other potential data is sent to the server in the http request body it doesn t have to be request parameters that is sent in the http request body it could be pretty much any data like a file or a soap request web service request to give you access to the request body of an http post request you can obtain an inputstream pointing to the http request body here is how it is done inputstream requestbodyinput request getinputstream note you will have to call this method before calling any getparameter method because calling the getparameter method on an http post request will cause the servlet engine to parse the http request body for parameters once parsed you cannot access the body as a raw stream of bytes anymore what you do with the data read from the inputstream is up to you the servlet engine does not help you parse or interprete that data you just get it raw session it is possible to obtain the session object from the httprequest object too the session object can hold information about a given user between requests so if you set an object into the session object during one request it will be available for you to read during any subsequent requests within the same session time scope here is how you access the session object from the httprequest object httpsession session request getsession servletcontext you can access the servletcontext object from the httprequest object too the servletcontext contains meta information about the web application for instance you can access context parameters set in the web xml file you can forward the request to other servlets and you can store application wide parameters in the servletcontext too here is how you access the servletcontext object from the httprequest object servletcontext context request getsession getservletcontext as you can see you have to first get the session object to get access to the servletcontext object 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 difference between servletconfig and servletcontext in java servlet servlets auto page refresh servlet filters servlets environment setup what is web application servlet 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
|