As I mentioned in the title of this question, I want to compare two strings in jsp file but the result doesn't look good. I implemented a
<c:when test="${userProduct.term.label == 'tháng'}">
123
</c:when>
<c:when test="${userProduct.term.label}.equals('tháng')">
456
</c:when>
When running the two ways above, I don't have any good result and I received following error message:
/jsp/user.page.top.product.jsp(59,8) PWC6038: "${userProduct.term.label == 'tháng'" contains invalid expression(s): javax.el.ELException: Error Parsing: ${userProduct.term.label == 'tháng'
Caused by:
org.apache.jasper.JasperException: /jsp/user.page.top.product.jsp(59,8) PWC6038: "${userProduct.term.label == 'tháng'" contains invalid expression(s): javax.el.ELException: Error Parsing: ${userProduct.term.label == 'tháng'
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:78)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:373)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:185)
at org.apache.jasper.compiler.JspUtil.validateExpressions(JspUtil.java:649)
at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1357)
at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1133)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:850)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1501)