Skip to main content Accessibility help
×
Hostname: page-component-78c5997874-dh8gc Total loading time: 0 Render date: 2024-11-08T07:49:13.682Z Has data issue: false hasContentIssue false

14 - A Java web server

Published online by Cambridge University Press:  08 January 2010

Clark S. Lindsey
Affiliation:
Space-H Services, Maryland
Johnny S. Tolliver
Affiliation:
Oak Ridge National Laboratory, Tennessee
Thomas Lindblad
Affiliation:
Royal Institute of Technology, Stockholm
Get access

Summary

Introduction

A web server program runs continuously while waiting for and answering requests it receives over the Internet from browsers. Typically the requestor asks for the transmission of a web page in HTML (Hypertext Markup Language) format or asks for some other HTTP (Hypertext Transmission Protocol) service such as the running of a CGI (Common Gateway Interface) program.

Developing web servers and server applications such as online stores became the first big money-making business area that used Java extensively. Sun offers additional packages with the Java 2 Platform Enterprise Edition (J2EE) to support server development for applications such as database access, shopping cart systems for web stores, and other elaborate middleware services that can scale to large numbers of client users. Companies like IBM and BEA have been quite successful in selling their own middleware Java software.

In this chapter and the next we look at a simple socket-based approach to building web servers for specialized applications [1–4]. This can be done with the classes available in J2SE. In Chapters 16–20 we focus on RMI (Remote Method Invocation) clients and servers and other distributed computing techniques. In Chapter 21 we return to web-based networking with a discussion of web services.

We show here how to create a simple web server that could run on any platform that implements a JVM with the java.net and java.io packages.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2005

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Trail: Custom Networking – The Java Tutorial, Sun Microsystems, http://java.sun.com/docs/books/tutorial/networking/
E. R. Harold, Java Network Programming, 2nd edition, O'Reilly, 2000
P. Niemeyer and Jonathan Knudsen, Learning Java, 2nd edition, O'Reilly, 2002
Budi Kurniawan, How Java Web Servers Work, Aug. 23, O'Reilly's OnJava.com, 2003, www.onjava.com/pub/a/onjava/2003/04/23/java_webserver.html
Security in Java 2 SDK 1.2 – The Java Tutorial, Sun Microsystems, http://java.sun.com/docs/books/tutorial/security1.2/
Permissions in the Java 2SDK Guide, Sun Microsystems, 2002, http://java.sun.com/j2se/1.4.2/docs/guide/security/permissions.html

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×