Complete Code Listings

Now that we've see how the code works and how to build shopping-cart functionality with WAP, you can reference the complete code listings in the following section. The code listings can also be found on the CD-ROM that accompanies this book.

login.jsp

Listing 18.1 The login.jsp File Creates the Login Page
 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd"> <% response.setContentType("text/vnd.wap.wml"); %> <%@ page import="java.sql.*, javax.servlet.http.Cookie" %> <% Connection dbConn = null; int CartID=-1; ResultSet get_cart = null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); dbConn = DriverManager.getConnection( "jdbc:odbc:shop" ...

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.