I need to call a javascript function on thymeleaf template, something like this:
Case 1:
<select th:onclick="${'function1('a')'}">
But in this case the thymeleaf not work.. some researchs ago (including stackoverflow) I get the followings "solutions":
Case 2:
<select th:onclick="${'function1(''a'')'}">
Case 3:
<select th:onclick="${'function1('a')'}">
Case 4:
<select th:onclick="${'function1(''+'a'+'')'}">
But in all cases I get the same error: "...Exception evaluating SpringEL expression..."
My problem is about javascript callings, I need put some parameters ${var} for call in js function. How I can fix that ?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…