简体   繁体   English

JSP如果是,则递增

[英]JSP If YES then Increment

I have a set variable "vColspan" which has a value of 4 我有一个设置变量“ vColspan”,其值为4

I also have two if conditionals, that if they are NOT EMPTY, I would like to them to EACH add 1 to vColSpan 我还有两个if条件,如果它们不是Empty,我想将它们分别添加到vColSpan中

Then after those two conditional have been checked, I will set the colspan of my table with the variable vColspan. 然后,在检查完这两个条件后,我将使用变量vColspan设置表的colspan。

What is the proper syntax to increment ac:set variable? 增加ac:set变量的正确语法是什么?

Here is my code so far: 到目前为止,这是我的代码:

<c:set var="vColspan" scope="session" value="4"/>

<c:if test="${!empty vs.Data1}">
   what do I put here?                          
</c:if>

<c:if test="${!empty vl.Data2}">
    and what do I put here?                 
</c:if>

<td colspan="<c:out value="${vColspan}"/>">

怎么样

<c:set var="vColspan" scope="session" value="${vColspan + 1}" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM