如何在EL中连接字符串?
我想做这样的事情,但它不起作用:
${var1 == 0 ? 'hi' : 'hello ' + var2}
Run Code Online (Sandbox Code Playgroud)
它抛出异常试图转换'hello'为Double
在我的jsp页面中,我指定:
<c:choose>
line 1: <c:when test="${com.community_classification_id.contains('1')}">
<input type="checkbox" id="by_invitation1" name="invitaion" value="1" checked="true">By Invitation<span style="padding-left:28px"></span>
</c:when>
<c:otherwise>
<input type="checkbox" id="by_invitation1" name="invitaion" value="1">By Invitation<span style="padding-left:28px"></span>
</c:otherwise>
</c:choose>
Run Code Online (Sandbox Code Playgroud)
但@line没有.1它给我500错误
The function contains must be used with a prefix when a default namespace is not specified
Run Code Online (Sandbox Code Playgroud)
我无法理解它.怎么了?
我正在尝试将一个字符串放在一个标签库中,如下所示:
<c:set var="columnText" value="${fn:join(columnText,'.pdf')}" />
<a href="${fn:join('http://host:8082/pdf/',columnText)}" >bla</a>
Run Code Online (Sandbox Code Playgroud)
但是会出现这个异常:
javax.el.ELException: 无法将类 java.lang.String 类型的 abcedfg 转换为类 [Ljava.lang.String;
'abcdefg' 最初是 columnText 的内容。