Servlet JApplet: HttpSession

穿精又带淫゛_ 提交于 2019-12-13 07:30:12

问题


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();

回答1:


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

  • Integrate an easy-to-use library for client-side cookie handling


来源:https://stackoverflow.com/questions/4722171/servlet-japplet-httpsession

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!