原创

jsp中 判断字符串相等不等

相等

<c:if test="${username.equals('TJG')}">
             <form:select path="portcode"
                    htmlEscape="false" class="input-medium">
                    <form:option label="天津港" value="1" />
                </form:select> 
            </c:if>

不等

<c:if test="${username != 'TJG' || username != 'LG' || username != 'NG'}">
               <form:select path="portcode"
                    htmlEscape="false" class="input-medium">
                    <form:option label="请选择 ......" value="" />
                    <form:options items="${portlist}" itemLabel="portname"
                        itemValue="portcode" />
                </form:select>

            </c:if>
正文到此结束
Loading...