How to set the JSTL variable value in java script?
As an answer I say No. You can only get values from jstl to javascript. But u can display the user name using javascript itself. Best ways are here. To display user name, if u have html like
You can display user name as follows.
var val1 = document.getElementById('userName').value;
document.getElementById('uName').innerHTML = val1;
var userName = ' ';
here ${user} is the data you get as response(from backend).
var arrayLength = ;
function advanced(){
var values = new Array();
values.push("No user found");
values.push("${user.name}");
alert("values[0] "+values[0]);
});