Book contents
- Frontmatter
- Contents
- Preface
- Acknowledgements
- Part I Introduction to Java
- Part II Java and the network
- 13 Java networking basics
- 14 A Java web server
- 15 Client/server with sockets
- 16 Distributed computing
- 17 Distributed computing – the client
- 18 Java Remote Method Invocation (RMI)
- 19 CORBA
- 20 Distributed computing – putting it all together
- 21 Introduction to web services and XML
- Part III Out of the sandbox
- Appendix 1 Language elements
- Appendix 2 Operators
- Appendix 3 Java floating-point
- Index
- References
14 - A Java web server
Published online by Cambridge University Press: 08 January 2010
- Frontmatter
- Contents
- Preface
- Acknowledgements
- Part I Introduction to Java
- Part II Java and the network
- 13 Java networking basics
- 14 A Java web server
- 15 Client/server with sockets
- 16 Distributed computing
- 17 Distributed computing – the client
- 18 Java Remote Method Invocation (RMI)
- 19 CORBA
- 20 Distributed computing – putting it all together
- 21 Introduction to web services and XML
- Part III Out of the sandbox
- Appendix 1 Language elements
- Appendix 2 Operators
- Appendix 3 Java floating-point
- Index
- References
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 PressPrint publication year: 2005