整理了一些wap入门知识点,收集了一些wap网站学习资料
(一) 添加 MIME 映射 , 注册 WAP 页面类型文件
如何在 IIS ( Microsoft Internet Information Server )上建立 WAP 网站
1 .在 IIS 平台创建一个新的 MIME 类型 先选择 WAP 站点的属性,再加入 MIME 类型,然后选择 HTTP Headers 标签。
在 MIME Map 部分,点击 File Type 并且输入以下信息:
|
Associated Extension
|
MIME Type
---|---
wml
|
text/vnd.wap.wml
wmlc
|
application/vnd.wap.wmlc
wbmp
|
image/vnd.wap.wbmp
wmlsc
|
application/vnd.wap.wmlscriptc
wmls
|
text/vnd.wap.wmlscript
wsc
|
application/vnd.wap/wmlscriptc
完成以后,将会显示以下几种类型:
( 二 ). 用 IE 浏览 WAP 页面 .
如果您的 IE 不能正常浏览 WAP ,可能您的 IE 浏览器可能屏蔽了 Activex 技术。您可以设置 IE 浏览器属性。
打开 IE--> 工具菜单 -->Internet 选项 --> 弹出对话框,如下图。选择安全选项卡,点击 “ 自定义级别 ” ,出现 “ 安全设置 ” 对话框,根据图 2 所示,选择启用,然后确定即可。
请参考下图:
图 1
图 2
( 三 ). 强制输出 WML 格式 , 可供多种设备类型访问
强制输出 WML:
在 web.config
添加下面内容
1<system.web> 下
2
31\.
4<browsercaps>
5<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b 03f 5f 7f11d 50a 3a"></result>
6<use var="HTTP_USER_AGENT"></use>
7preferredRenderingType = "wml11"
8preferredRenderingMime = "text/vnd.wap.wml"
9preferredImageMime = "image/vnd.wap.wbmp"
10</browsercaps>
112\. 如果定义相关其它属性可以完整的移动设置属性 :
12<browsercaps>
13<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b 03f 5f 7f11d 50a 3a"></result>
14<use var="HTTP_USER_AGENT"></use>
15browser=Unknown
16version=0.0
17majorversion=0
18minorversion=0
19frames=false
20tables=false
21cookies=false
22backgroundsounds=false
23vbscript=false
24javascript=false
25javaapplets=false
26activexcontrols=false
27win16=false
28win32=false
29beta=false
30ak=false
31sk=false
32aol=false
33crawler=false
34cdf=false
35gold=false
36authenticodeupdate=false
37tagwriter=System.Web.UI.Html32TextWriter
38ecmascriptversion=0.0
39msdomversion=0.0
40w3cdomversion=0.0
41platform=Unknown
42css1=false
43css2=false
44xml=false
45mobileDeviceManufacturer = "Unknown"
46mobileDeviceModel = "Unknown"
47gatewayVersion = "None"
48gatewayMajorVersion = "0"
49gatewayMinorVersion = "0"
50preferredRenderingType = "wml11"
51preferredRenderingMime = "text/vnd.wap.wml"
52preferredImageMime = "image/vnd.wap.wbmp"
53defaultScreenCharactersWidth = "12"
54defaultScreenCharactersHeight = "6"
55defaultScreenPixelsWidth = "96"
56defaultScreenPixelsHeight = "72"
57defaultCharacterWidth = "8"
58defaultCharacterHeight = "12"
59screenBitDepth = "1"
60isColor = "false"
61inputType = "telephoneKeypad"
62numberOfSoftkeys = "0"
63maximumSoftkeyLabelLength = "5"
64canInitiateVoiceCall = "false"
65canSendMail = "true"
66hasBackButton = "true"
67rendersWmlDoAcceptsInline = "true"
68rendersWmlSelectsAsMenuCards = "true"
69rendersBreaksAfterWmlAnchor = "false"
70rendersBreaksAfterWmlInput = "false"
71rendersBreakBeforeWmlSelectAndInput = "true"
72requiresAttributeColonSubstitution = "true"
73requiresPhoneNumbersAsPlainText = "false"
74requiresUrlEncodedPostfieldValues = "false"
75requiredMetaTagNameValue = ""
76rendersBreaksAfterHtmlLists = "true"
77requiresUniqueHtmlCheckboxNames = "true"
78requiresUniqueHtmlInputNames = "true"
79requiresUniqueFilePathSuffix = "true"
80supportsCss = "false"
81hidesRightAlignedMultiselectScrollbars = "false"
82canRenderAfterInputOrSelectElement = "true"
83canRenderInputAndSelectElementsTogether = "true"
84canRenderOneventAndPrevElementsTogether = "true"
85canCombineFormsInDeck = "true"
86canRenderMixedSelects = "true"
87canRenderPostBackCards = "true"
88canRenderSetvarZeroWithMultiSelectionList = "true"
89supportsImageSubmit = "true"
90supportsSelectMultiple = "true"
91requiresHtmlAdaptiveErrorReporting = "false"
92requiresContentTypeMetaTag = "false"
93requiresDBCSCharacter = "false"
94requiresOutputOptimization = "false"
95supportsAccesskeyAttribute = "false"
96supportsInputIStyle = "false"
97supportsInputMode = "false"
98supportsIModeSymbols = "false"
99supportsJPhoneSymbols = "false"
100supportsJPhoneMultiMediaAttributes = "false"
101maximumRenderedPageSize = "2000"
102requiresSpecialViewStateEncoding = "false"
103requiresNoBreakInFormatting = "false"
104requiresLeadingPageBreak = "false"
105supportsQueryStringInFormAction = "true"
106supportsCacheControlMetaTag = "true"
107supportsUncheck = "true"
108canRenderEmptySelects = "true"
109supportsRedirectWithCookie = "true"
110supportsEmptyStringInCookieValue = "true"
111cachesAllResponsesWithExpires = "false"
112requiresNoSoftkeyLabels = "false"
113defaultSubmitButtonLimit = "1"
114supportsBold = "false"
115supportsItalic = "false"
116supportsFontSize = "false"
117supportsFontName = "false"
118supportsFontColor = "true"
119supportsBodyColor = "true"
120supportsDivAlign = "true"
121supportsDivNoWrap = "false"
122supportsCharacterEntityEncoding = "true"
123isMobileDevice="false"
124</browsercaps>
125
126( 四 ).WML
127
1281 、 XML 程序的基本结构
129
130一个简单的页面开始。
131
132< ?xml version = "1.0" ? >
133< !DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
134"http://www.wapforum.com/DTD/wml_1.1.xml" >
135< wml >
136< card title = "wap" >
137<p> Hello! </p>
138
139
140
141---
142
143** 此程序在手机上显示 ** Hello!
144
145WML 语言是一个很严格的,哪怕一点不同都会导致错误。所有的 WML 程序必须在文件的开头处声明 XML 文件类型,包括 XML 的版本, WML 的文档类型、所用规范等。声明形式如下 :
146
147< ?xml version = "1.0" ? >
148< !DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
149"http://www.wapforum.com/DTD/wml_1.1.xml" >
150
151---
152
153WML 文档是由 “ 卡片( Card ) ” 和 “ 卡片组( Deck ) ” 构成的,一个 Deck 是一个或多个 Card 的集合。当客户端发出请求之后, WML <span style="FONT-SIZE: 9pt; COLOR: #333333; FONT-FAMILY: 宋体; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-font-kerning: 0pt; mso-bidi-fon</system.web>