我试图比较两个字符串,但我无法得到我需要的结果
我试过这些格式:
<c:choose>
<c:when test="${company == multi }">
<a href="dashResumo.jsp?tr=<%=tr%>&company=VVO&nm=<%=nmTorr%>"></a>
<a href="dashResumo.jsp?tr=<%=tr%>&company=GPA&nm=%=nmTorr%></a>
</c:when>
</c:choose>
<c:choose>
<c:when test="${company == 'multi' }">
<a href="dashResumo.jsp?tr=<%=tr%>&company=VVO&nm=<%=nmTorr%>"></a>
<a href="dashResumo.jsp?tr=<%=tr%>&company=GPA&nm=%=nmTorr%>">GPA</a>
</c:when>
</c:choose>
<c:choose>
<c:when test="${company.equals("multi") }">
<a href="dashResumo.jsp?tr=<%=tr%>&company=VVO&nm=<%=nmTorr%></a>
<a href="dashResumo.jsp?tr=<%=tr%>&company=GPA&nm=%=nmTorr%></a>
</c:when>
</c:choose>
但这些格式都不适合我。
使用JSTL-1.2库
答案 0 :(得分:1)
试试这个:
<c:choose>
<c:when test="${company eq 'multi'}">
<a href="dashResumo.jsp?tr=<%=tr%>&company=VVO&nm=<%=nmTorr%>">VVO</a>
<a href="dashResumo.jsp?tr=<%=tr%>&company=GPA&nm=<%=nmTorr%>">GPA</a>
</c:when>
</c:choose>