1.jsp页面截取以逗号分隔的字符串并循环输出

jsp页面截取值操作方式


        <c:forEach var="applyUserType" items="${fn:split(userScoreRule.applyUserType, ',')}" varStatus="num">
            <c:if test="${num.index ne 0 }">,</c:if>
            <c:choose>
             <c:when test="${applyUserType eq 1}">
              司机
             </c:when>
             <c:when test="${applyUserType eq 2}">
              个人货主
             </c:when>
             <c:when test="${applyUserType eq 3}">
              企业货主
             </c:when>
             <c:when test="${applyUserType eq 4}">
              货运信息部
             </c:when>
             <c:when test="${applyUserType eq 5}">
              物流公司
             </c:when>
            </c:choose>
         </c:forEach>

2.jsp页面截取字符串并用其他字符取代

jsp页面截取值操作方式


不知道为什么res.accountName + '1',因为可以用${fn:replace(res.accountName,fn:substring(res.accountName,7,11),'****')}来实现,但是呢会出现有的电话号码是185********形式,暂时还没找到加1的原因


<li title="用户:<c:if test='${not empty res.accountName}'>${fn:replace(res.accountName + '1',fn:substring(res.accountName + '1',7,12),'****')} </c:if>,您已经通过了实名认证<c:if test='${not empty res.belongArea}'>(${res.belongArea})</c:if><fmt:formatDate value='${res.authTime}' pattern='yyyy-MM-dd'/>">

相关文章:

  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-12-14
  • 2021-06-10
  • 2021-10-18
  • 2022-12-23
  • 2021-11-11
猜你喜欢
  • 2021-05-02
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案