Sun JSP (Java Server Pages)

JSP uses the page contentType directive to specify content MIME type. To specify the MIME type for a WAP card, the following syntax is used:

<%@ page.contentType="text/vnd.wap.wml" %>

Listing E.6 is the JSP code used to create the output seen in Figure E.1.

Listing E.6 hello.jsp—JSP WML Welcome Card
<%@ page.contentType="text/vnd.wap.wml" %>

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">

<wml>
   <card title="Welcome">
      <p>
         WAP is cool!
      </p>
   </card>

</wml>

Note

For more information on JSP visit http://java.sun.com/products/jsp/

Get WAP Development with WML and WMLScript 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.