admin管理员组文章数量:1426300
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 badges2 Answers
Reset to default 5session 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.
本文标签: javaHow to set a value in JSP session using javascriptStack Overflow
版权声明:本文标题:java - How to set a value in JSP session using javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745407566a2657319.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论