jsp - <c:choose> not interpreted, all <c:when> and <c:otherwise> bodies are evaluated -
i wanna show state of user when logged in web site. found out better use el tags. didnt work. please me.
<c:choose> <c:when test="${null}" > ${"welcome unknown user"} </c:when> <c:otherwise> <c:out> ${"welcome dear"} ${sessionstateuser} </c:out> </c:otherwise> </c:choose>
i don't think c:choose -> c:when block constructed correctly. also, why texts referenced variables?
it should more this:
<c:choose> <c:when test="${sessionstateuser == null}" > welcome unknown user </c:when> <c:otherwise> welcome dear <c:out value="${sessionstateuser}"/> </c:otherwise> </c:choose>
i don't see reason need line: var= "test" value = "${sessionstateuser}"
- in case, naming variable test confusing because jsp test attribute.
Comments
Post a Comment