简体   繁体   English

Servlet JApplet:HttpSession

[英]Servlet JApplet: HttpSession

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 我正在写一个小的JApplet,它将向服务器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: 我找到了一些有关httpsession的信息,但我永远找不到一个信息:

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 我必须在applet中创建会话对象还是在applet端执行此类操作时有自动系统创建httpsession?

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

You need to keep track of session at server in servlet. 您需要跟踪servlet中服务器上的会话。

and from java applet you need to maintain cookie in header while requesting. 从Java Applet,您需要在请求时在标题中维护cookie。

Also See 另请参阅

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM