jstl一些标签 中timestamp类型在页面去掉时分秒!

jstl一些标签 中timestamp类型在页面去掉时分秒!| Id | Title | DateAdded | SourceUrl | PostType | Body | BlogId | Description | DateUpdated | IsMarkdown | EntryName | CreatedTime | IsActive | AutoDesc | AccessPermission |

| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------| -------------|
| 16938002| jstl一些标签 中timestamp类型在页面去掉时分秒!| 2022-11-30T11:55:00| | BlogPost|

<fmt:formatDate value='${vo.updateDate}' pattern='yyyy-MM-dd'/>

 
 

JSTL 的 if else : 有 c:if 没有 else 的处理

分类:
JSP/JAVA/J2EE(11)
 
jstl的c:if 没有else
 
想要实现if...else...:
 
  可以用下面的解决
 
 --------------------------------------------------------------------
 
 结构:
 
 
<c:choose>
   <c:when test="">    如果
   </c:when>
   
   <c:otherwise>  否则
   </c:otherwise>
 
  </c:choose>
 
 
 
代码:
 
 <c:choose>
 
    <c:when test="${sessionScope.USERTYPE == 'inner'}">
 
      <c:set value="${context_root}/igmgr/MEB004.dow" var="action" scope="page"/>
 
    </c:when>
 
    <c:when test="${sessionScope.USERTYPE == 'merc'}">
 
      <c:set value="${context_root}/igmgr/MEB021.dow" var="action" scope="page"/>
 
    </c:when>  
 
   <c:otherwise>  
 
      <c:set value="${context_root}/igmgr/MEB020.dow" var="action" scope="page"/>
 
   </c:otherwise>
 
  </c:choose>
 
 -------------------------------------------------------------------------
 
 附:详解+代码
 
 在同一个 <c:choose> 中,当所有 <c:when> 的条件都没有成立时,则执行 <c:otherwise> 的本体内容。
 
  语法
 
  <c:otherwise>
 
  本体内容
 
  </c:otherwise>
 
  属性
 
  无
 
  限制
 
  ·<c:otherwise> 必须在 <c:choose> 和 </c:choose>之间
 
  ·在同一个 <c:choose> 中时,<c:otherwise> 必须为最后一个标签
 
  说明
 
  在同一个 <c:choose> 中,假若所有 <c:when> 的test属性都不为true时,则执行 <c:otherwise> 的本体内容。
 
  范例
 
  笔者举一个典型的 <c:choose>、<c:when>和<c:otherwise>范例:
 
  <c:choose>
 
  <c:when test="${condition1}">
 
  condition1为true
 
  </c:when>
 
  <c:when test="${ condition2}">
 
  condition2为true
 
  </c:when>
 
  <c:otherwise>
 
  condition1和condition2都为false
 
  </c:otherwise>
 
  </c:choose>
 
  范例说明:当condition1为true时,会显示“condition1为true”;当condition1为false且condition2为true时,会显示“condition2为true”,如果两者都为false,则会显示“condition1和condition2都为false”。
 
  注意
 
  假若condition1和condition2两者都为true时,此时只会显示"condition1为true",这是因为在同一个<c:choose>下,当有好几个<c:when>都符合条件时,只能有一个<c:when>成立
 
 
FOR 
 
 
 
                                                                                    <c:forEach items="${SurveyDirectorys }" var="en" varStatus="i">
                                                                                    <c:set var="isDoing" value="0"/>
                                                                                                <c:forEach items="${roles }" var="v" varStatus="i">
                                                                                                      <%-- <input type="checkbox" name="sd_${en.id}" value="${en.id}" checked="1" >${en.surveyName} --%>
                                                                                                      <c:choose>
                                                                                                      <c:when test="${v.ruleId eq en.id }"
                                                                                                
                                                                                                
                                                                                                                   <input type="checkbox" name="export_role" value="${role.id}" checked="1" >${en.surveyName}
                                                                                                            </c:when>
                                                                                                      <c:otherwise>
                                                                                                
                                                                                                                   <input type="checkbox" name="export_role" value="${role.id}"  >${en.surveyName}
                                                                                                            </c:otherwise>
                                                                                                      </c:choose>
                                                                                                </c:forEach>
                                                                                          </c:forEach>
 
| 648658| | 2022-11-30T11:55:00| false| | 2022-11-30T11:54:43.747| true| <fmt:formatDate value='${vo.updateDate}' pattern='yyyy-MM-dd'/> JSTL 的 if else : 有 c:if 没有 else 的处理 分类: JSP/JAVA/J2EE(11) 作者同类文章X jstl的c:if 没有else 想要实| Anonymous|
posted @   RalphLauren  阅读(9)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示