China Mobile launched from Internet page reminded charges, resulting in a lot of J2ME networking on the server, there is not the problem together.J2me program that started in the interconnection, in some areas, in some cases, mobile gateway will cut our request, the return of a tariff pages to remind us, so our servers will not receive our requests, resulting inPROGRAM network failure error.
Consequently, we are dealing with a network connection to add a page of mobile tariff treatment, we can send a network request, the returned http response to the detection of the first, if we detect the returned content-type is text / vnd.wap.wml, we can throw away the response, to re-initiate a request to solve the problem page charges, or charges that we can extract the request of the address inside the page, once again sending a request.
Handling code is as follows:
httpConn = (HttpConnection) Connector.open (url, permissions, true);
String s = httpConn.getHeaderField ("Content-Type");
if (s.equals ("text / vnd.wap.wml")) {
/ / Re-initiate a request
httpConn = (HttpConnection) Connector.open (url, permissions, true);
}
If the program is supposed to return to the type of WAP pages, WAP pages that we can parse the content of keywords to determine their own server returns the page or move the page to return again to remind the processing charges.