java - How to set a value in JSP session using javascript? - Stack Overflow

Is it possible to setassign value in session using java script?Basically, I have few links on my JSP p

Is it possible to set/assign value in session using java script?

Basically, I have few links on my JSP page and on click of those links, I need to set a variable in session.

Is it possible to set/assign value in session using java script?

Basically, I have few links on my JSP page and on click of those links, I need to set a variable in session.

Share Improve this question asked Mar 11, 2011 at 10:31 ajmajm 13.2k59 gold badges169 silver badges241 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

session is server side concept, while javascript plays on browser

  • You can either use ajax on click of those link make a request to server and pass the info. and set it to session @ server

Or

  • If those links on whichuser is going to click is your server's then pass some param with it. and track it at server

The easiest approach is to use a hidden input element bound to a bean property in session scope, and put a JavaScript onclick handler in a mandlink that sets the hidden element's value before submitting the page.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745407567a4626383.html

相关推荐

  • java - How to set a value in JSP session using javascript? - Stack Overflow

    Is it possible to setassign value in session using java script?Basically, I have few links on my JSP p

    9小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信