WAP Getting Started Technical Tutorial

xiaoxiao2021-03-06  41

First, configure the web server

In designing WAP web pages, whether you are using the WAP development tool is Up.SDK or Nokia WAP Tookit or Ericsson Wapide, you must set up a web server settings, so you will have a common settings of several web servers as follows: 1, Window NT platform IISA, Startup Menu -> Program -> Windows Nt Option Pack -> IIS4.0 B, right-click the sub-computer name of Internet Information Server, select 'attribute' C on the shortcut menu, lower part of the property page, There is a 'File Type (F)' button, click this button, the file type interface D, click the 'New Type' button, then fill in .WML in the relevant extension column, in the content type (MIME) Fill in the text / vnd.wap.wmle in the column, click 'OK' buttons F, repeat C, D, E three steps, and add other MIME types. 2, Apache Web Server ON NT OR Solaries or Linux or Other Unix A, whether it is NT or UNIX or Linux, is a conf / mime.types file B in the Apache installation directory, adding the following: Text / VND.WAP.WML .WML image / vnd.wap.wbmp .wbmp application / vnd.wap.wmlc .wmlc text / vnd.wap.wmls.wmls application / vnd.wap.wmlsc .wmlsc C, store D, restart Apache Web Server.

Second, WAP web design Getting Started here to introduce the marker language WML set by the WAP Protocol Standard Organization, since the HDML previously introduced is basically consistent on the characteristics of the mobile browser-specific web page, so the concept part is slightly, and the language is described directly. 1. Basic Rules * WML uses XML document character sets, currently supports Unicode 2.0, and HDML, WML's labels, attributes, and specified receiptable values ​​must be lowercase, the name and variable of Card are also case sensitive. Like HDML, only one space is displayed for continuous empty characters. The value of the label is required to use "or" there is no space between the property name, = and values. For labels that do not have pairs, you must add /, for example. In the reference The same is basically the same as HDML, with:

$ (VAR1: ESC) $ (var1: noesc) $ (var1: unsc) three forms, the specific meaning refers to the relevant part of the front HDML. On the same way to reserved characters, the corresponding replacement characters are: <>> '& apos "&&&& $ $$ space - here to point out the connection of the parameters during the transfer of the URL & Must be converted to &. 2. General format of basic format and file head WML file:

"http://www.wapforum.org/dtd/wml_1.1.xml"> , Meta ;/head>" Card> SME CONTENTS ... structure looks similar to the HTML file, for each dec k, the following statement must be specified in its document. Qian Note the case in the letter. For a deck, its file size is preferably not more than 1.2k. Label and HTML's tag, used to indicate this WML DECK, which has an optional XML: Lang property to set the language of the document, such as Indicates the document language as Chinese. As HTML tag contains information about the Desk. The tag can contain a tag and multiple tags. The tab is equivalent to the HTML, specifies the access control information of the DECK, which uses two optional properties, Domain is used to specify the domain, the default value For the current domain, the path is used to specify the path, the default value is "/", the root directory. Since is used alone, it is necessary to use / end, and will not be described again for similar situations.

and HTML is similar, providing META information of the deck. The attribute is a must, including three cases name = "name" UP.Link Server ignore META data http-equiv = "name" UP.LINK Server converts META data to HTTP response head (same html) user-agent = "Agent" UP.LINK Server directly transmits META data to the mobile device Content property is also a must, and its content is determined according to attribute. The scheme attribute is currently not supported. Forua is optional attribute, the tag is deleted by the intermediate agent before the WML file is transmitted to the client (because the protocol of the transmission may change), the default value is false. Currently supported META data: Specifies the storage time period in the phone memory cache, the default for 30 days (unless the memory is exhausted ), During which mobile phone is called directly from the cache for the DECK. If the information is sensitive to time, you can specify the survival period in the cache with the max-agn, the minimum unit is second, if specified as 0, then each time you need to call the DECK.

and Demonstration bookmarks Features. When the user makes a bookmark, the mobile browser first records the CARD with a tag, this tag default is the title attribute in the tab (will be said in the future), and then when the user selects the bookmark, The browser will open the recorded URL. But because of the default, the phone will record all decks, so general is used to make the phone do not record the current URL, that is, . In addition, if you want to specify a URL that is different from the current DRECK for bookmarks, use the URL "/> specified by * The ID attribute is used to specify the name of the Card, which can be used to jump between the CARD, which is equivalent to jump in the page in HTML to jump in the page . * Title property is used as a tag tag, which is generally not displayed on the screen. * NewContext properties, the default value is false, is used to indicate that the phone is not to clear the previously reserved information, including variables, history of the stack, reset the phone status, etc. * ORDERED attribute, the default value is true, indicating that the content in the CARD is displayed in a fixed order, or is displayed by the user's selection. This is different from HTML, and the content in the CARD page can be displayed in a certain order. The default is to display in linear order, that is, according to the order of the code, but to note that the following three labels must be written in the following order Onevent> , (this is related to the "event" you have to say). This is to make it easy to fill in the form. When Ordered is set to True, if the content of a form cannot be displayed in one screen, it is divided into multi-screen display; when Ordered is set to FALSE, the phone can display a summary Card to summarize the effective Options, users can fill in from the selected table selection. * ONXXX attributes, similar to the ONXXX attribute in the HTML tab, is used to capture the event, perform the specified operation (task) when the event is triggered, where is a stenown of a URL.

3. Text

WML is basically equal to HTML on the display of text. The text paragraph is included in

and , the align property specifies the alignment of the paragraph, the default is Left, other can choose Right and Center; Mode property specified When a row does not automatically wrap when all words are automatically wrap, the default is the automatic wrap WRAP. If NOWRAP is selected, the browser will display all text through a mechanism similar to the horizontal scroll bar. The wrap tag is also the same, here for a few, if there are multiple or by it can be used to the specified URL Pass data in the form of "variable name / value". Name and Value properties are required. Note that only the variables here are used to submit to the CGI program. In addition to , you can also add a sentence or more sentence , which is the meaning when you trigger an event, except and . Assign the variable. It should be noted that when there is no statement between and , use in the form of , this is more special, such as news .

2) Used to press the URL of the current page into the URL historical stack, and open the previous URL, if the URL does not exist, is invalid. Syntax Similar to : , and , if it is not added, it must become . 3) Used to refresh the current page, so that the variables within the page are refreshed, the syntax is .

4) , said nothing, the tag cannot be used in , generally used in (later explanation).

Third, when I use analog mobile phone to browse the WAP page, the Chinese characters show the settings of garbled or compile errors. There are several ways to set: 1. When setting the MIME table in the web server, after Text / VND.Wap.WML Plus "; charset = charset_name", such as GB2312 Chinese characters: text / vnd.wap.wml; charset = GB2312 Content Mime Type Extension WML text / vnd.wap.wml; charset = charset_name WML

2. If you are designing a dynamic WAP page, Chinese characters display garbled, you can specify the character set used in the program. In the program, after the CHARSET is added to the user browser, it will be written as follows: "Content-Type: text / vnd.wap.wml; charSet = GB2312". As in ASP: Response.contentType = "text / vnd.wap.wml; charSet = GB2312", more similar in server-side scripts such as PHP, Perl. 3, you can also convert your program code to UTF8, or Unicode with the character conversion tool. 6. The display form is similar to

,
can be used to include a set of tables, but not required. As mentioned earlier, when is set to False, the phone can display a summary card to summarize the effective option, so that the user is filled in, the summary Card is based on
and the independent input box And menu , menu , used to enter text, except that the NAME attribute is necessary, other options. * Name properties, specify the name of the variable used to store the input text. * Title property, the name of the input box, can also be used as an option name in the profile CARD page. * TYPE attribute, the default value is text, if Password is selected, the input data is displayed *. * VALUE attribute, equivalent to the following default attribute, * default property, specify the default value of the input box, that is, the Name property specifies the default value of the variable, when the user enters the new value, this value is invalid if the value is The phone is not compliant with the following format attributes, the phone is also ignored the default value. * Format property, used to format the input data, the available tags are available as follows, using "one digital tag" and "* tag" form, the former represents N tag type characters, such as 3X, the latter represents any (Less than the value of the MaxLength property) tag type character.

Tag Description A Any symbol or uppercase letter (excluding numbers) A Any symbol or lowercase letter (excluding numbers) n Any number (excluding symbols or letters) x any symbol, number or uppercase letter (not changed to lowercase letters) X Any symbol, number or lowercase letter (not changed to uppercase letters) m, any symbol, number or uppercase letter (can be changed to lowercase letters) or multiple characters, the default is any symbol, number or lowercase letters (can be changed) Underline letters, multiple characters, default is the first word lowercase * maxlength attribute, specifying the maximum character length that the user can enter, maximum of 256 characters. * EMPTYOK attribute, indicating whether the user does not fill the input box, and the default is false, that is, fill. * Size property, the input box is displayed, and it is not supported. * TabINDEX attribute, which is similar to which option is in the Observer on the HTML form,

This value determines this selection order, and the number is large. Not supported.

TEST4.WML ---------------

username: password: Comments: to change the value of Odered in the previous example to "True", then join

and Fieldset Title = "Field1"> and Try it. , and between the HTML form can include the and

* Name property, used to store the variable name of the user selection, the value of the value of the can be used to combine multiple , and , can include and

When the user returns to the previous CARD using the task, or press the Back button. Ontimer When expires.

TEST7.WML ---------------

"http://www.wapforum.org/dtd/wml_1.1.xml">

please select a city ...