Set server-side variables in your JSP template via a js:clientStore
custom tag for consumption by the JavaScript:
<%-- Arbitrary JSP variables --%>
<c:set var="a" val="1" />
<c:set var="b" val="2" />
<c:set var="c" val="3" />
<%-- Store the "a" and "b" JSP variables under "my.namespace" --%>
<js:clientStore