| Author |
Access session variable in JavaScript
|
Varsha Garud
Greenhorn
Joined: Jan 18, 2013
Posts: 2
|
|
Same here i want to access a session variable in javascript..
in java i can access it by getServletContext().getInitParameter("DATE_FORMAT") (where DATE_FORMAT is my session variable)
I want to access this varaible in javascript..How to do that??
Might be a lame question but need help..
Thank you in advance [/color]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
You can't. Not directly.
What you can do to is to create JavaScript markup that assign the value to a JavaScript variable. As in:
assuming that the value is a String.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Access session variable in JavaScript
|
|
|