Java is an open, standard, general-purpose network program running platform, Java-written applications can be applied to a variety of different platforms and terminals without modifying the program, similarly, WAP based mobile phones can also use Java platform or with back-end server interaction to complete a variety of complex functions. Have you ever thought that sitting in a car or walking on the road can easily manage your complex Internet or local area network. This problem can be solved by using the Java servlet.
Here is a simple Java servlet program that allows you to monitor your network on WAP-enabled handsets, similar to a DOS ping command. This program performs a ping on your host and displays the results on your phone. Use such as: Http://host/servlet/WAPping or the IP address as a parameter to the host, such as: http://host/servlet/WAPping?IP_address
You can change commonly used settings in the configuration file, the servlet program must take the configuration file name as the initial parameter, the parameter describes a text file name, the file holds the information you set.
For Web.xml in Tomcat, you can set:
<servlet>
<servlet-name>WAPping</servlet-name>
<servlet-class>WAPping</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>config file path
</init-param>
</servlet>
In the configuration file, empty rows and rows beginning with # or file://are ignored, and the following parameters are currently supported:
# prefix is used for host commands, the default value is NULL
# for a host based on NT system, you must set up prefix=command.com/c
Prefix=command.com/c
# ping option, default value is null
# For example 3 displays the request and interprets the address to the host name:
Ping=-n 3-a