直接使用eclipse開發就可以,wap沒有什么特別的,和開發普通的java程序一樣的,只是展示曾需要定義一下wap的標簽就可以。
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/vnd.wap.wml; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<%
// 自動解析PC web請求還是mobilephone web請求
String acceptHeader = request.getHeader("accept");
if (acceptHeader.indexOf("application/vnd.wap.xhtml+xml") != -1)
response.setContentType("application/vnd.wap.xhtml+xml");
else if (acceptHeader.indexOf("application/xhtml+xml") != -1)
response.setContentType("application/xhtml+xml");
else
response.setContentType("text/html");
%>