Submitted by heartin on Sun, 03/02/2014 - 02:58
Submitted by heartin on Sat, 03/01/2014 - 22:23
Internet is a global system of interconnected computer networks that connect various Domain Name System (DNS) servers, web hosting servers, home and business users, etc. Internet is a network of networks.
Lot of data transfer happens in an internet between computers and networks, and there should be some rules to regulate these transfers. A communications protocol is a system of digital rules for data exchange within or between computers.
Submitted by heartin on Mon, 12/17/2012 - 02:11
A servlet is a java class that conform to the servlet specification and need to be deployed to a servlet container to work as a servelt. A servlet’s life cycle consist of Servlet class loading, Servlet instantiation, and then methods init(), service() and destroy().
Submitted by heartin on Fri, 04/11/2014 - 22:04
Parameters may come into our application from the client request, or may be configured through deployment descriptor (web.xml) elements or their corresponding annotations. When you submit a form, form values are sent as request parameters to a web application. In case of a GET request, these parameters are exposed in the URL as name value pairs and in case of POST, parameters are sent within the body of the request.
Submitted by heartin on Tue, 04/02/2013 - 00:56
Similar to scope and lifetime of variables in Java as you have seen in blocks-and-methods-in-java, parameters and attributes in a Java EE web application also have scope and lifetime in the context of the web application. The scope of a parameter/attribute denotes the availability of that parameter/attribute for use. A web application serves multiple requests from clients when it is up and running. These requests can be from same client or different clients.
Submitted by heartin on Sun, 12/16/2012 - 18:44
HTTP is a synchronous request-response application network protocol. Client sends a request specifying one of the seven HTTP methods, the location of the resource to be invoked, a set of optional headers and an optional message body. The server sends back a response containing the version of HTTP we are using, a response code, a description of the response code, a set of optional headers, and an optional message body. HTTP is the primary protocol for most web applications on the Internet, regardless of whether they are written in Java, PHP or ASP.
Submitted by heartin on Fri, 03/20/2015 - 11:37
Filters are pluggable classes that stand between the client and a target component (like a servlet or JSP), within a web application. We can do pre or post processing of request/response data while it is coming from client to a servlet or from the servlet back to a client. Before filters were introduced in Java EE, we had to use servlets with RequestDispatcher to achieve pre or post processing of request/response data. Filters add a lot of flexibility over servlet for such extra processing which is not directly involved in response creation.
Submitted by heartin on Fri, 03/20/2015 - 13:14
There are four main entities involved in the HTTP request-response model:
- Web container
We will learn about request and response here.
Container provides us with two objects corresponding to request and response, encapsulating the request details and an empty response object when a request is received. These object interfaces also contain many convenience methods. These are passed through the service method of the servlet, which will then pass to us through the doXXX methods.
Submitted by heartin on Fri, 03/20/2015 - 13:23
Below methods work with the metadata properties carried by requests:
String getProtocol () E.g. HTTP/1.1
String getScheme() E.g.: http, https, ftp etc.
Submitted by heartin on Fri, 03/20/2015 - 13:33
ServletResponse encapsulates basic properties of a response independent of protocol and provide output streams to write content to client, independent of protocol.
There are two response streams
Java.io.OutputStream for binary data
Java.io.writer for character data