Servlet的JApplet的:HttpSession中 [英] Servlet JApplet: HttpSession

查看:193
本文介绍了Servlet的JApplet的:HttpSession中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这听起来像一个简单的问题,但我不能找到很好的信息。

我正在写一个小JApplet的将要发送一些信息到服务器的servlet

我希望能够跟踪是谁,所以我想把日志记录和和会话的制度谁。

我发现了大约HttpSession中的一些信息,但我永远无法找到一个信息:

我必须在我的小程序来创建一个会话对象还是有,当我做这样的事情在小程序端创建HttpSession中的自动系统

  HttpURLConnection的CON =(HttpURLConnection类)u.openConnection();
con.setDoInput(真);
con.setRequestMethod(GET);
con.connect();


解决方案

您需要的servlet来跟踪会话在服务器上。

和Java小程序,你需要保持在头的cookie同时要求。

请参见

This sounds like a simple question but I can't find good information.

I'm writing a small JApplet that will be sending some info to a server servlet

I want to be able to track who is who so I want to put up a system of logging and and session.

I found some information about httpsession but I can never find one information:

Do I have to create a session object in my applet or is there an automatic system that creates the httpsession when I do something like this on the applet side

HttpURLConnection con = (HttpURLConnection) u.openConnection ();
con.setDoInput(true);
con.setRequestMethod("GET");
con.connect();

解决方案

You need to keep track of session at server in servlet.

and from java applet you need to maintain cookie in header while requesting.

Also See

这篇关于Servlet的JApplet的:HttpSession中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆