Lesson 6 | The Java Web Server |
Objective | What is the Java Web Server? |
The Java Web Server is just what the name suggests, a Web server written in Java.
The Java Web Server supports servlets.
Unlike the JSDK server, it supports all sorts of other requests, too, so you can test your whole site with it.
In addition, you can host your production site with it, if your computer and your network connection are up to the task.
Oracle iPlanet Web Server
Oracle iPlanet Web Server, formerly known as Sun Java System Web Server or Sun ONE Web Server, delivers a secure infrastructure for hosting different web technologies and applications for enterprises. Oracle iPlanet Web Server is designed to provide the following benefits: Handle high throughput requirements
Reduce the risk of potential security exploits and vulnerabilities while maximizing uptime Significantly reduce operational and deployment costs for enterprises It can be downloaded from the following link
Web Tier
There are many Web servers that support servlets, but we recommend you use Apache Tomcat.
tomcat.apache.org
With some servers, servlets might not quite be implemented correctly.
In the next lesson, you will learn how to download and install the Java Web Server.
HTTP is a simple, stateless protocol. A client, such as a web browser, makes arequest, the web server responds, and the transaction is done. When the clientsends a request, the first thing it specifies is an HTTP command, called a method, that tells the server the type of action it wants performed.
This first line of therequest also specifies the address of a document (a URL) and the version of the HTTP protocol it is using. For example: GET /intro.html HTTP/1.0 This request uses the GET method to ask for the document named intro.html, using
HTTP Version 1.0. After sending the request, the client can send optional header information to tell the server additional information about the request, such as what software the client is running and what content types it understands.
This information does not directly pertain to what was requested, but it could be used by the server in generating its response. Here are some sample request headers:
User-Agent:
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36
Accept: image/gif, image/jpeg, text/*, */*
The User-Agent header provides information about the client software, while the Accept header specifies the media (MIME) types that the client prefers to accept. After the headers, the client sends a blank line, to indicate the end of the header section.
The client can also send additional data, if appropriate for the method being used, as it is with the POST method that we will discuss later. If the request does not send any data, it ends with an empty line.
After the client sends the request, the server processes it and sends back a response. The first line of the response is a status line that specifies the
- version of the HTTP protocol the server is using,
- a status code, and
- a description of the status code.