answersLogoWhite

0

Http servlet response and http request?

Updated: 8/18/2019
User Avatar

Wiki User

13y ago

Best Answer

HttpServletRequest and HttpServletResponse are the two objects that signify the request received by a servlet and the response sent by it after it is done processing the request. Both the request and response can carry data objects (variables) that can be accessed by the entity receiving the request/response object.

They are both an integral part of J2EE Applications.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Http servlet response and http request?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are types of servlet?

Http servlet and Generic servlet


What use import javaxservlethttpHttpServletRequest in java?

The Http RequestWhen a user hits a URL with a servlet at the other end, the Servlet Container creates an HttpServletRequest object. It passes this object as an argument to the servlet's service methods (doPut(), doGet(), and doPost()). There is a lot of information in this object, including the login details of the user making this request and the name of the HTTP method with which this request was made.


What is persistent http with pipelining?

in persistent HTTP with pipelining browser caters to multiple http requests and it cannot wait for the response http message for the previous request.


What is response in web applications?

Response is the HTTP stream sent from the Web server to the browser. Request is the HTTP stream sent from the browser to the Web server.


How do you Retrieve data from drop down box in one servlet and pass to another servlet?

The data that is present in a web page is available in the Form object of the page which can be accessed from the HTTP Request. If the request object gets passed from one servlet to another the data also would get passed.


How does http operate?

HTTP is a request and response based protocol to transfer web contents. When you click the browser's 'go" button after putting the URL, then actually http sends the Get request to the specified web server's IP to have the request data for you-thus you see the web contents on your computer screen by the use of http.


What is generic servlet class?

GenericServlet defines a generic, protocol-independent servlet whereas HttpServlet Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site that uses the Http Protocol.


Difference between HTTP servlet and Generic servlet?

The difference is that a GenericServlet has no defined protocol (it is "generic"), while HttpServler uses the HTTP protocol. HttpServlet is a subclass of GenericServlet with the purpose of creating a servlet for a web site.


What 2 different between persistent HTTP with pipelining and persistent HTTP without pipelining in communication network?

In persistent HTTP without pipelining, the browser first waits to receive a HTTP response from the server before issuing a new HTTP request. In persistent HTTP with pipelining, the browser issues requests as soon as it has a need to do so, without waiting for response messages from the server.


Why http is asynchronous?

HTTP is a text based protocol for exchanging data over a network, and the preferred protocol for the Internet (a.k.a. World Wide Web) HTTP is synchronous: a client issues a request and waits for the corresponding response before anything else is done. Asynchronous Javascript And XML (AJAX) is a way of using a HTTP request from the web browser to retrieve data using JavaScript, without leaving the current page. This use is said to be asynchronous because the JavaScript is making the HTTP request does not wait for the response, but instead continues any further necessary processing. A handler function is called to deal with the response, as and when it arrives. So the real answer to the question as it stands is: HTTP is not asynchronous.


How does Apache httpd work?

Tomcat is a servlet container, and the following is how a servlet container works The init, service, and destroy methods are the servlet's lifecycle methods. The init method is called once by the servlet container after the servlet class has been instantiated to indicate to the servlet that it being placed into service. The init method must complete successfully before the servlet can receive any requests. A servlet programmer can override this method to write initialization code that needs to run only once, such as loading a database driver, initializing values, and so on. In other cases, this method is normally left blank. The service method is then called by the servlet container to allow the servlet to respond to a request. The servlet container passes a javax.servlet.ServletRequest object and a javax.servlet.ServletResponse object. The ServletRequest object contains the client's HTTP request information and the ServletResponse encapsulates the servlet's response. These two objects enable you to write custom code that determines how the servlet services the client request. The servlet container calls the destroy method before removing a servlet instance from service. This normally happens when the servlet container is shut down or when the servlet container needs some free memory. This method is called only after all threads within the servlet's service method have exited or after a timeout period has passed. After the servlet container calls destroy, it will not call the service method again on this servlet. The destroy method gives the servlet an opportunity to clean up any resources that are being held (for example, memory, file handles, and threads) and make sure that any persistent state is synchronized with the servlet's current state in memory. For Better Picture, Visit below article full of images to clear the concept : http://shivasoft.in/blog/java/servlet/how-container-handles-the-servlet-request/


What is the web server response to the web client GET request?

The response from the server is: HTTP/1.1 200 OK This means that the request from the client succeeded. If the page you requested is already stored in the cache of your browser you will get: HTTP/1.1 304 Not Modified This means that the page has not been modified since it was stored in your cache.