javascript - Java/JS/JSTL - how to get property from javabean/display error message -
this question has answer here:
in html, need property bean , store in variable - how can this?
what i'm trying is, display error message when user's login fail - know can javascript, don't know how can "call" javascript load when login unsuccessful.
many ways this.. don't know how of them.
like html , css, js part of template text. let jsp print if js variable.
<script>var foo = '${bean.foo}';</script>
you need make sure generated html looks way js understands it.
<script>var foo = 'bar';</script>
with jsp/jstl/el can control output whatever way want. can use jstl <c:if>
print conditionally. can use el conditional operator ${condition ? printiftrue : printiffalse }
toggle output based on condition. etcetera.
Comments
Post a Comment