SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,kenrick Mock
Chapter:
Java Never Ends
Exercise:
Programming Projects
Question:6 | ISBN:9780132830317 | Edition: 5

Question

This project shows how to create a simple Web server. Create a server program that listens on port 8000. When a client connects to the server, the program should send the following data to the client,

"HTTP/1.0 200 OK\n\n" + body

where body is the String "<HTML><TITLE>Java Server</TITLE>This web page was sent by our simple <B>Java Server</B></HTML>". If you know HTML, feel free to insert your own content. The header line identifies the message as part of the HTTP protocol that is used to transmit Web pages.

When the server is running, you should be able to start a Web browser and navigate to your machine on port 8000 and view the message. For example, if the server is running on your local machine, you could point your Web browser to http://localhost:8000 and the message in body should be displayed.


TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.