android 客户端(非浏览器)怎么与服务器session保持同步会话
2014-10-17 10:38
573 查看
============问题描述============
小弟在做一个客户端的购物车功能,要获取到服务器session中保存的购物车列表,上传了sessionid却依旧没法获取到购物车,代码在下面:
String urlString = "http://192.168.1.128:8080/Pinzhuo04/servlet/ShowCartServlet";
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(
urlString).openConnection();
httpURLConnection.setRequestProperty("cookie", sessionid);
httpURLConnection.setConnectTimeout(5000);
httpURLConnection.setRequestMethod("POST");
if (httpURLConnection.getResponseCode() != -1) {
InputStream inputStream = httpURLConnection.getInputStream();
return XMLparse(inputStream);
}
============解决方案1============
http://blog.csdn.net/chindroid/article/details/7556363
小弟在做一个客户端的购物车功能,要获取到服务器session中保存的购物车列表,上传了sessionid却依旧没法获取到购物车,代码在下面:
String urlString = "http://192.168.1.128:8080/Pinzhuo04/servlet/ShowCartServlet";
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(
urlString).openConnection();
httpURLConnection.setRequestProperty("cookie", sessionid);
httpURLConnection.setConnectTimeout(5000);
httpURLConnection.setRequestMethod("POST");
if (httpURLConnection.getResponseCode() != -1) {
InputStream inputStream = httpURLConnection.getInputStream();
return XMLparse(inputStream);
}
============解决方案1============
http://blog.csdn.net/chindroid/article/details/7556363
相关文章推荐
- Android客户端访问服务器保持SESSION会话的实现
- Android客户端访问服务器保持SESSION会话的实现
- android 客户端与服务器 保持同一会话的session
- 客户端(ios和android)与服务器之间的会话管理(session和cookie)
- android客户端通过webServcie与服务器交互,如何保持Session
- 怎么通过web服务器访问MYSQL数据库,使其数据同步到android SQLite数据库?
- Android 通过httpclient请求web服务器,并解决用户登录session保持
- [高可用性] 负载均衡,会话保持,session同步
- android与WEB服务器交互时,如何保证在同一个会话Session中通信
- 负载均衡,会话保持,session同步
- android与WEB服务器交互时,如何保证在同一个会话Session中通信(转)
- [高可用性] 负载均衡,会话保持,session同步
- 怎么通过web服务器访问MYSQL数据库,使其数据同步到android SQLite数据库?
- android与WEB服务器交互时,如何保证在同一个会话Session中通信
- android与WEB服务器交互时,如何保证在同一个会话Session中通信
- android与WEB服务器交互时,如何保证在同一个会话Session中通信
- 负载均衡,会话保持,session同步
- Android与WEB服务器交互时,如何保证在同一个会话Session中通信
- 负载均衡,会话保持,session同步
- 关于android客户端访问web服务器session问题。