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 ...
Get Java Servlet Programming, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.