This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Servlets and the fly likes HttpServletResponse and HttpServletRequest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpServletResponse and HttpServletRequest" Watch "HttpServletResponse and HttpServletRequest" New topic

HttpServletResponse and HttpServletRequest

sohaib rahman

Joined: Jun 01, 2010
Posts: 20
What is the use of HttpServletResponse and HttpServletRequest?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

To respectively represent an http request and an http response. If you've never heard about that, you need to read some basics about the http protocol. There are some explanation at Wikipedia.

[My Blog]
All roads lead to JavaRanch
David Newton

Joined: Sep 29, 2008
Posts: 12617

Did looking them up not help at *all*?! Is this an interview question? If so, I'm baffled for multiple reasons: if you're interviewing for a position for which you'd be asked this, I'd be concerned if you didn't know. If you didn't know, I'd be concerned you couldn't just look it up.
Alpesh Padra
Ranch Hand

Joined: Jan 10, 2010
Posts: 41
We should not discourage anybody.

Its part of HTTP protocol for communication between server and client.
I agree. Here's the link:
subject: HttpServletResponse and HttpServletRequest
jQuery in Action, 3rd edition