mardi 7 février 2017

C:choose behaves unexpectedly in JSP

Vote count: 0

I wrote the below code in order to forward the current page to another jsp page when the value of msgCode is "Error". To test it I wrote as below

<%  


   java.lang.String msgCode = "Error"; 


  %>
<c:choose>
<c:when test="${msgCode.equals('Error')}">
    <jsp:forward page="duplicate.jsp" />
    <br />
</c:when> 
<c:otherwise>
  //The code enter inot this block instead of when block
</c:otherwise>
</c:choose>

When I ran the code it enters into otherwise block instead of when block. May I know the reason for this. Thanks in advance

asked 35 secs ago

Let's block ads! (Why?)



C:choose behaves unexpectedly in JSP

Aucun commentaire:

Enregistrer un commentaire