| « | may 2026 | » | | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | | | | | | | |
| 公告 |
| 暂无公告... |
| Blog信息 |
|
blog名称: 日志总数:29 评论数量:19 留言数量:0 访问次数:119528 建立时间:2006年5月29日 |

| |
|
[java与中文]j2me连接jsp页面 软件技术
krf301 发表于 2007/4/12 18:30:40 |
|
第一种方法:
String host = set.getUrlString().toString().trim(); String url = "http://" + host + ":7878/test/chaxun.jsp"; String message = urlEncode("lianxifangshi=" + set.getPassword().toString().trim() + "&xingming=" + set.getName().toString().trim() + "&xueqi=" + choiceId);
HttpConnection conn;
if (cmnet) { conn = (HttpConnection) Connector.open(url + message); Waitting wait = new Waitting(true, hrMidelt, this); Display.getDisplay(hrMidelt).setCurrent(wait); while (conn.getResponseCode() != HttpConnection.HTTP_OK) { } wait.exit(); Display.getDisplay(hrMidelt).setCurrent(this); } else { conn = (HttpConnection) Connector.open("http://10.0.0.172" + ":7878/test/chaxun.jsp?lianxifangshi=" + set.getPassword().toString().trim() + "&xingming=" + set.getName().toString().trim() + "&xueqi=" + choiceId); // conn.setRequestProperty("X-Online-Host", host);
}通过此种方法可以顺利实现无线连接jsp服务,访问到数据库。并非一定要经过servlet来进行访问。
|
|
|