Build a WAP application development environment

xiaoxiao2021-03-06  52

J2ME Development Network has recently opened Java technology and WAP development topics, which will mainly describe WAP development and part of Java technology. No longer open up new article columns, if users publish WAP-related technologies, please enter Java technology and WAP development topics.

WAP (Wireless Application Protocal is an open protocol, which is different from Japan's I-MODE, and the latter is closed. WAP is actually a combination of wireless networks and Internet networks. Original wireless network is mainly carrying voice services, while the Internet's data business is very mature. Due to the need for data traffic in the wireless network, it promotes the formation of WAP. You can even think that WAP is a lightweight HTTP protocol that is tailored for the wireless network.

As a developer, we should learn about WAP's working principle and programming mode. If you have a web application development experience, it will be easier to understand. In fact, it is a model of B / S. Browser here is not a browser in the traditional sense but to support user agents on WAP devices, and it is also understood as a WAP browser. The server is a general web server, you can use IIS, Apache, or other web servers, because HTML is not suitable for transmitting over resources, so we use WML languages ​​on your server. In fact, when the user accesses the network through the wireless device, first request the WAP gateway, the WAP gateway will make the data appropriately codec, and then send the data request to the web server, and then the data is sent after the data is encoded after the WAP gateway. Go to the phone. And this is transparent to the programmer, you only need to manage the code of Server. Below this picture helps you understand this programming mode, if you want to know more about WAP knowledge, I recommend you to see a "mobile Internet and WAP technology", although not deep but it is clear.

Since our server can use a general web server, then here I use Tomcat5.0 as a web server, first you need to download Tomcat5.0 from http://www.apache.org. Assume that the installation path is C: / Tomcat 5.0. Set good Catalina_Home = C: / tomcat 5.0 in an environment variable. Set good java_home = c: /j2sdk1.4.2_03. Go to the Catalina_Home / bin directory, run the Startup boot Tomcat, the default port is 8080. Open the browser Enter http: // localhost: 8080 in the address. See that Tom cat explains the installation. The version of Tomcat5.0 generally has supported WML. If you don't support it, modify Catalina_Home / Conf / Web.xml. Add the following: WML text / vnd.wap.wml WMLC application / vnd.wap.wmlc WMLS text / vnd.wap.wmlscript WMLScriptc application / vnd.wap.wmlscriptc You can also in Welcome- Add index.wml in List as the default access page index.wml index.html index.htm index.jsp This server is already available to develop WAP applications.

At the time of debugging, we need to debug on the WAP browser. I chose the WinWap browser as an development and debugging tool, which is very convenient. First, download the latest WinWap 3.1pro version from http://www.winwap.org, 30 days of trial period. Like the installation and other applications, let's write a simple WML file test, advanced usage of WML and WML Script will be introduced in subsequent articles. Index.Wml

hello www.j2medev.com put this file in Catalina_Home / WebApps / Root / Next, Enter http: // Yourip: YourPort / Index.wml in the address after starting WINWAP, will see Hello www.j2medev.com if you have an embedded WAP browser And you can test the mobile phone, you can test it, I use the Nokia6108 test success. I hope this will help everyone.

转载请注明原文地址:https://www.9cbs.com/read-116488.html

New Post(0)