不是用session吗? EJB用sesson Bean.
解决方案 »
- urlrewrite问题
- 请教除了用xml,如何将键值对的字符串以结构化表示?
- 数据库读取照片问题
- 怎么解决从数据库端读出来数据的乱码问题
- jsp参数传递计算
- 高手进来看看啊
- 做个在线聊天 比如A用户登陆了 B又登陆了 A那边不显示B 是只能让他每格几秒刷新一次页面吗 有别的方法吗
- 再再请教数据库操作遇到的问题..
- 用java监控浏览器的行为?
- ServletContext@13828333[app:cg module:cg path:/cg spec-version:2.5], re
- tomcat4.1.24中用admin 管理页面配置好连接池后,不能取得连接....
- HttpSessionBindingListener 接口,大侠来帮忙!!!来着有分。
不可能的,http协议是无连接状态 ,除非你指定一个参数去传递
String sIP = r.getString("ServerIP");
String sPort = r.getString("ServerPort");
URL url = new URL("http://"+sIP+":"+sPort+"/corp/HttpMtServlet");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println(strusername+"&"+strpasswd+"&"+strtonum+"&"+strtext+"&"+strpresendtime+"&"+strmoid+"&"+strfromnum+"&"+strpaynum+"&"+strserviceid+"&"+strfeetype+"&"+strfeeusertype+"&"+strfee+"&"+strformat);
out.close();
BufferedReader in
= new BufferedReader(new InputStreamReader(connection.getInputStream()));
while ((line = in.readLine()) != null) {
returnStr = returnStr + line;
System.out.println(line);
} in.close();
你在后台servlet中给session设一个值.
然后你下次提交来取这个值,如果可以的话那们你前端不用做任何改动啊.说明这只是服务端的机制啊.
而且象一般web中的session它也是在服务端相互传值,跟前台没关系啊.
正如 pantech_36(*_*叮噹猫^_^) 所说的。