SlideShare a Scribd company logo
1 of 10
JSP - Client Request
Prof. Neeraj Bhargava
Kapil Chauhan
Department of Computer Science
School of Engineering & Systems Sciences
MDS University, Ajmer
JSP - Client Request
 When a browser requests for a Webpage, it sends a lot
of information to the web server. This information
cannot be read directly because this information
travels as a part of header of HTTP request.
Header Information
 Accept
This header specifies the MIME types that the browser
or other clients can handle. Values
of image/png or image/jpeg are the two most
common possibilities.
 Accept-Encoding
This header specifies the types of encodings that the
browser knows how to handle. Values
of zip or compress are the two most common
possibilities.
Header Information
 Accept-Language
This header specifies the client's preferred languages
in case the servlet can produce results in more than
one language.
 Authorization
This header is used by clients to identify themselves
when accessing password-protected webpages.
Header Information
 Connection
This header indicates whether the client can handle
persistent HTTP connections. Persistent connections
permit the client or other browser to retrieve multiple
files with a single request. A value of Keep-
Alive means that persistent connections should be
used.
 Content-Length
This header is applicable only to POST requests and
gives the size of the POST data in bytes.
Header Information
 Cookie
This header returns cookies to servers that previously
sent them to the browser.
 Host
This header specifies the host and port as given in the
original URL.
Method & Description
 Cookie[] getCookies()
Returns an array containing all of the Cookie objects
the client sent with this request.
 Enumeration getAttributeNames()
Returns an Enumeration containing the names of the
attributes available to this request.
Method & Description
 HttpSession getSession()
Returns the current session associated with the this
request, or if the request does not have a session,
creates one.
 String getMethod()
Returns the name of the HTTP method with which
this request was made, for example, GET, POST
Method & Description
 String getPathInfo()
Returns any extra path information associated with the
URL the client sent when it made this request.
 String getProtocol()
Returns the name and version of the protocol the
request uses.
Assignment Question
 Explain JSP client request with suitable example and
describe
(i)header (ii) method.

More Related Content

What's hot

Java serverpages
Java serverpagesJava serverpages
Java serverpagesAmit Kumar
 
Node js Modules and Event Emitters
Node js Modules and Event EmittersNode js Modules and Event Emitters
Node js Modules and Event EmittersTheCreativedev Blog
 
Session12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection FrameworkSession12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection Frameworkmuthusvm
 
Software performance testing_overview
Software performance testing_overviewSoftware performance testing_overview
Software performance testing_overviewRohan Bhattarai
 
HTTP fundamentals for developers
HTTP fundamentals for developersHTTP fundamentals for developers
HTTP fundamentals for developersMario Cardinal
 

What's hot (9)

Java serverpages
Java serverpagesJava serverpages
Java serverpages
 
URL Class in JAVA
URL Class in JAVAURL Class in JAVA
URL Class in JAVA
 
Node js Modules and Event Emitters
Node js Modules and Event EmittersNode js Modules and Event Emitters
Node js Modules and Event Emitters
 
Http
HttpHttp
Http
 
What's up with HTTP?
What's up with HTTP?What's up with HTTP?
What's up with HTTP?
 
Session12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection FrameworkSession12 J2ME Generic Connection Framework
Session12 J2ME Generic Connection Framework
 
Software performance testing_overview
Software performance testing_overviewSoftware performance testing_overview
Software performance testing_overview
 
HTTP fundamentals for developers
HTTP fundamentals for developersHTTP fundamentals for developers
HTTP fundamentals for developers
 
Week3 lec 1
Week3 lec 1Week3 lec 1
Week3 lec 1
 

Similar to Here are the key points about JSP client request:- When a browser makes an HTTP request to a web server, it sends various header information like Accept, Accept-Encoding, Accept-Language etc. - The header provides metadata about the client and its capabilities. For example, Accept specifies MIME types understood, Accept-Encoding specifies encoding formats.- JSP provides various methods to access this header and other request information on the server side.- getCookies() returns any cookies sent by the client. getAttributeNames() returns request attributes. - getSession() returns or creates an HTTP session. getMethod() returns the request method like GET. - getPathInfo() and getProtocol

Bt0083 server side programing
Bt0083 server side programing Bt0083 server side programing
Bt0083 server side programing Techglyphs
 
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptHTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptVietAnhNguyen337355
 
Under the Covers with the Web
Under the Covers with the WebUnder the Covers with the Web
Under the Covers with the WebTrevor Lohrbeer
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...WebStackAcademy
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Syed Ariful Islam Emon
 
Chapter 1.Web Techniques_Notes.pptx
Chapter 1.Web Techniques_Notes.pptxChapter 1.Web Techniques_Notes.pptx
Chapter 1.Web Techniques_Notes.pptxShitalGhotekar
 
Csajsp Chapter5
Csajsp Chapter5Csajsp Chapter5
Csajsp Chapter5Adil Jafri
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1hussulinux
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009Cathie101
 
The introduction of RESTful
The introduction of RESTful The introduction of RESTful
The introduction of RESTful Jon Chen
 
Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systemsReza Gh
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.pptkstalin2
 

Similar to Here are the key points about JSP client request:- When a browser makes an HTTP request to a web server, it sends various header information like Accept, Accept-Encoding, Accept-Language etc. - The header provides metadata about the client and its capabilities. For example, Accept specifies MIME types understood, Accept-Encoding specifies encoding formats.- JSP provides various methods to access this header and other request information on the server side.- getCookies() returns any cookies sent by the client. getAttributeNames() returns request attributes. - getSession() returns or creates an HTTP session. getMethod() returns the request method like GET. - getPathInfo() and getProtocol (20)

HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 
Bt0083 server side programing
Bt0083 server side programing Bt0083 server side programing
Bt0083 server side programing
 
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptHTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
 
Under the Covers with the Web
Under the Covers with the WebUnder the Covers with the Web
Under the Covers with the Web
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 4...
 
Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3Ch2 the application layer protocols_http_3
Ch2 the application layer protocols_http_3
 
Basics Of Servlet
Basics Of ServletBasics Of Servlet
Basics Of Servlet
 
Chapter 1.Web Techniques_Notes.pptx
Chapter 1.Web Techniques_Notes.pptxChapter 1.Web Techniques_Notes.pptx
Chapter 1.Web Techniques_Notes.pptx
 
Csajsp Chapter5
Csajsp Chapter5Csajsp Chapter5
Csajsp Chapter5
 
PHP Training: Module 1
PHP Training: Module 1PHP Training: Module 1
PHP Training: Module 1
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
The introduction of RESTful
The introduction of RESTful The introduction of RESTful
The introduction of RESTful
 
Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systems
 
Starting With Php
Starting With PhpStarting With Php
Starting With Php
 
Copy of cgi
Copy of cgiCopy of cgi
Copy of cgi
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
 
Servlet
ServletServlet
Servlet
 

More from chauhankapil

Gray level transformation
Gray level transformationGray level transformation
Gray level transformationchauhankapil
 
Elements of visual perception
Elements of visual perceptionElements of visual perception
Elements of visual perceptionchauhankapil
 
Markov decision process
Markov decision processMarkov decision process
Markov decision processchauhankapil
 
RNN basics in deep learning
RNN basics in deep learningRNN basics in deep learning
RNN basics in deep learningchauhankapil
 
Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)chauhankapil
 
Bayesian probabilistic interference
Bayesian probabilistic interferenceBayesian probabilistic interference
Bayesian probabilistic interferencechauhankapil
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in javachauhankapil
 
Knowledge acquistion
Knowledge acquistionKnowledge acquistion
Knowledge acquistionchauhankapil
 
Knowledge based system
Knowledge based systemKnowledge based system
Knowledge based systemchauhankapil
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logicschauhankapil
 
Types of inheritance in java
Types of inheritance in javaTypes of inheritance in java
Types of inheritance in javachauhankapil
 
Representation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logicsRepresentation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logicschauhankapil
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javachauhankapil
 
Propositional logic
Propositional logicPropositional logic
Propositional logicchauhankapil
 
Constructors in java
Constructors in javaConstructors in java
Constructors in javachauhankapil
 
Circular linked list
Circular linked listCircular linked list
Circular linked listchauhankapil
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked listchauhankapil
 

More from chauhankapil (20)

Gray level transformation
Gray level transformationGray level transformation
Gray level transformation
 
Elements of visual perception
Elements of visual perceptionElements of visual perception
Elements of visual perception
 
Markov decision process
Markov decision processMarkov decision process
Markov decision process
 
RNN basics in deep learning
RNN basics in deep learningRNN basics in deep learning
RNN basics in deep learning
 
Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)Introduction to generative adversarial networks (GANs)
Introduction to generative adversarial networks (GANs)
 
Bayesian probabilistic interference
Bayesian probabilistic interferenceBayesian probabilistic interference
Bayesian probabilistic interference
 
Jsp
JspJsp
Jsp
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Knowledge acquistion
Knowledge acquistionKnowledge acquistion
Knowledge acquistion
 
Knowledge based system
Knowledge based systemKnowledge based system
Knowledge based system
 
Introduction of predicate logics
Introduction of predicate  logicsIntroduction of predicate  logics
Introduction of predicate logics
 
Types of inheritance in java
Types of inheritance in javaTypes of inheritance in java
Types of inheritance in java
 
Representation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logicsRepresentation of syntax, semantics and Predicate logics
Representation of syntax, semantics and Predicate logics
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Constructors in java
Constructors in javaConstructors in java
Constructors in java
 
Methods in java
Methods in javaMethods in java
Methods in java
 
Circular linked list
Circular linked listCircular linked list
Circular linked list
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 
Linked list in DS
Linked list in DSLinked list in DS
Linked list in DS
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 

Here are the key points about JSP client request:- When a browser makes an HTTP request to a web server, it sends various header information like Accept, Accept-Encoding, Accept-Language etc. - The header provides metadata about the client and its capabilities. For example, Accept specifies MIME types understood, Accept-Encoding specifies encoding formats.- JSP provides various methods to access this header and other request information on the server side.- getCookies() returns any cookies sent by the client. getAttributeNames() returns request attributes. - getSession() returns or creates an HTTP session. getMethod() returns the request method like GET. - getPathInfo() and getProtocol

  • 1. JSP - Client Request Prof. Neeraj Bhargava Kapil Chauhan Department of Computer Science School of Engineering & Systems Sciences MDS University, Ajmer
  • 2. JSP - Client Request  When a browser requests for a Webpage, it sends a lot of information to the web server. This information cannot be read directly because this information travels as a part of header of HTTP request.
  • 3. Header Information  Accept This header specifies the MIME types that the browser or other clients can handle. Values of image/png or image/jpeg are the two most common possibilities.  Accept-Encoding This header specifies the types of encodings that the browser knows how to handle. Values of zip or compress are the two most common possibilities.
  • 4. Header Information  Accept-Language This header specifies the client's preferred languages in case the servlet can produce results in more than one language.  Authorization This header is used by clients to identify themselves when accessing password-protected webpages.
  • 5. Header Information  Connection This header indicates whether the client can handle persistent HTTP connections. Persistent connections permit the client or other browser to retrieve multiple files with a single request. A value of Keep- Alive means that persistent connections should be used.  Content-Length This header is applicable only to POST requests and gives the size of the POST data in bytes.
  • 6. Header Information  Cookie This header returns cookies to servers that previously sent them to the browser.  Host This header specifies the host and port as given in the original URL.
  • 7. Method & Description  Cookie[] getCookies() Returns an array containing all of the Cookie objects the client sent with this request.  Enumeration getAttributeNames() Returns an Enumeration containing the names of the attributes available to this request.
  • 8. Method & Description  HttpSession getSession() Returns the current session associated with the this request, or if the request does not have a session, creates one.  String getMethod() Returns the name of the HTTP method with which this request was made, for example, GET, POST
  • 9. Method & Description  String getPathInfo() Returns any extra path information associated with the URL the client sent when it made this request.  String getProtocol() Returns the name and version of the protocol the request uses.
  • 10. Assignment Question  Explain JSP client request with suitable example and describe (i)header (ii) method.