O'Reilly logo

Java Servlet Programming, 2nd Edition by William Crawford, Jason Hunter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Sending Multimedia Content

Until now, every servlet we’ve written has returned a standard HTML page. The web consists of more than HTML, though, so in this chapter we’ll look at some of the more interesting things a servlet can return. We’ll start by looking at the new WAP protocol and the WML markup language used by cell phones and mobile devices and see how servlets can use this new technology. Then we’ll show how to generate images dynamically from a servlet to create charts and manipulate pictures. Toward the end of the chapter we’ll explore when and how to send a compressed response and examine using multipart responses to implement server push.

WAP and WML

The Wireless Application Protocol (WAP, pronounced like whap) is a de facto standard for providing Internet communications to mobile phones, pagers, and personal digital assistants (PDAs) on wireless networks across the world. It was created in 1998 by Ericsson, Nokia, Motorola, and Phone.com (formerly Unwired Planet) who wisely desired to create a standard protocol rather than competing proprietary protocols. Together the four companies founded the WAP Forum (http://www.wapforum.org), a democratically organized group whose participation has since grown to more than 400 members.

WAP consists of a set of specifications for developing applications to run on wireless networks. The WAP Protocols covers both the application level (the WML markup language and the WMLScript scripting language, collectively known as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required