js, el, java variables access each other

*, If you want to use variables like el expressions in js code:

function demo() {
     var args = '${obj.temp}';
     //Where obj is the object in the background setAttrbute(), and temp is its variable name
}

 

*, if you want to use java variables or codes in js code

function demo() {
     var args = '<%= request.getAttrbute("temp")%>';
     // where temp is the object in the background setAttrbute(), obviously not as easy to use as above
}

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326719415&siteId=291194637