Wireless Application Protocol (WAP) is a global standard for applications over wireless networks. It means that WAP provides a uniform technology platform with consistent content formats and protocols for delivering Internet and Intranet information to digital mobile phones and other wireless devices. Wireless Markup Language (WML) is used to create pages that can be displayed in a WAP browser. WML is a markup language based on the Extensible Markup Language (XML) and is used to specify the format and presentation of text, hierarchies of screens (known as a "deck"), and hyperlinks between those screens (or "cards"). It is designed for specifying user interface behavior and displaying content on wireless devices such as phones, pagers, and Personal Digital Assistants (PDAs).
The WAP operates as follows:
IPage TransformationBeans are a set of intelligent beans that are capable of writing out the appropriate markup language for a particular device. Unlike other webAF TransformationBeans, the IPage TransformationBeans write out an entire JSP page to the device or browser making the request. Most of this information is found within the JSP page's request headers. For example, if a user accesses a JSP page containing an IPage from their cell phone, the IPage bean will produce either WML (Wireless Markup Language) or HDML (Handheld Device Markup Language) based on the type of browser the cell phone contained. If another user accesses the same JSP page using Internet Explorer, the IPage bean would produce HTML instead.
When a mobile phone or other wireless device tries to access an IPage JSP page, the bean first determines what type of markup language to return. The IPage bean will then write out the entire page by first writing out the header of the page. A phone which contains a WML browser would receive the following lines as a header from the JSP page:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
Header output is similarly written for HDML enabled phones or HTML browsers accessing the page. After writing out the header, the IPage specific markup is written to the page. This might be a page or card of text from an IPage bean, markup for an iMenu, or some type of user input described in an iForm bean. The footer is the last to be written. The following footer line would be written if the device was a phone with a browser which supported WML:
</wml>
The IPage TransformationBeans will enable the automatic generation of content using Java on the server using a JSP page. In this release, the following IPage TransformationBeans are available.
| IPage TransformationBean | Description |
|---|---|
| IText | Creates a single page of text |
| IMenu | Creates a menu used for navigation |
| IForm | Creates a form for obtaining user input |
The IText bean is used to write out an entire page or card of text. The JSP coder does not need to know the type of requesting device. Here is a small JSP page that uses the IText bean:
<%
com.sas.servlet.tbeans.ipage.IText text =
new com.sas.servlet.tbeans.ipage.IText(request, response);
text.setText("Hello World!");
text.setTitle("IText Example");
text.write(out);
%>
The first 2 lines create the IText bean and pass in the JSP page's request and response objects. The request object is used to determine what type of device is requesting the page. The response object will set the correct content type to return to the device. The setText and setTitle methods set the output to be displayed and the title of the IText. Calling the write method sends the final markup to the device. The resulting markup for the IText for WML, HDML, and HTML is as follows:
WML output:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="IText" title="IText Example">
<do type="prev">
<prev/>
</do>
<p>
Hello World!
</p>
</card>
</wml>
HDML output: <hdml version="3.0" public="true"> <display name="IText" title="IText Example"> Hello World! </display> </hdml>
HTML output: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <title> IText Example </title> </head> <body> Hello World! </body> </html>
There are many development tools out there to help you create WAP applications. Here are some of the tools currently available.
For related information about IPage and other TransformationBeans available in webAF, see webAF and the SAS Custom Tag Library.