• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can I maintain the session when call a servlet from an applet

 
Linda Xu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, ALL
In my project, I have a JSP page and a servlet. If I direct trigger the applet from the JSP page using
<FORM Action="/servlet/myServlet" METHOD ="post">
I can maintain the session that means in my servlet I can use:
HttpSession session = req.getSession();
session.getValue("itemName");
...
to retrieve the item from session.
But now, I have an applet on my JSP file, and I want to trigger myServlet from the applet using an HTTP call, can I still maintain the session? I mean can myServlet still use the same way to retrive stuff which the JSP put into the session?
Thank you very much for any comments!
 
parind poi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolutely yes.
Whether you invoke the servlet through a browser or an applet, since the protocol is HTTP, the web server services them all in the same manner.
Hope this helps.
Parind
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic