Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
117
rated 0 times [  118] [ 1]  / answers: 1 / hits: 32011  / 11 Years ago, thu, february 28, 2013, 12:00:00

  • I have a session variable in java file.(TestConnection.java)




session.setAttribute(CONNECTION_DBNAME, dbName);





  • How to read CONNECTION_DBNAME value into javascript file.(utility.js)


More From » java

 Answers
33
 First access the variable in scriptlet.

<%
String param= (String)session.getAttribute(CONNECTION_DBNAME);
%>

Then use like this.

<script>
var X = '<%=param%>';
</script>


then you can access the name using x.


[#79943] Wednesday, February 27, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
reed

Total Points: 725
Total Questions: 85
Total Answers: 89

Location: Singapore
Member since Sat, Jul 25, 2020
4 Years ago
;