<s:if test="<s:property value='item.name' />.contains('全能')">
1
</s:if>
写成这样不行,就是实现这样的功能用s:if去判断 <s:property value='item.name' /> 这个的值里面是否包含‘全能’两字,
用JSP 写 <%
String teamName1 = <s:property value="item.name" />
if (teamName1.contains("全能")) {
%>
<input type="hidden" id="sex" name="athlete.sex" value="男" /> <%
}
%>这样 页面直接报错了。
1
</s:if>
写成这样不行,就是实现这样的功能用s:if去判断 <s:property value='item.name' /> 这个的值里面是否包含‘全能’两字,
用JSP 写 <%
String teamName1 = <s:property value="item.name" />
if (teamName1.contains("全能")) {
%>
<input type="hidden" id="sex" name="athlete.sex" value="男" /> <%
}
%>这样 页面直接报错了。
String teamName1 = <s:property value="item.name" />
全能
</s:if>
请问这个该怎么写呢,我写成这样也不行~
1 </c:when> <c:otherwise>
2 </c:otherwise> </c:choose>
这样就OK
<s:if test="%{item.name.indexOf('全能')>=0}">
<c:choose> <c:when test="${fn:contains(item.name,'全能')}">
1 </c:when> <c:otherwise>
2 </c:otherwise> </c:choose>上面的标签少写了。这样就OK