zoukankan      html  css  js  c++  java
  • web开发jsp页面遇到的一系列问题

    一:web总结

    1.jsp页面知识点巩固
    1.1字符串数字格式化转换
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    
    整数带千分符显示:
    <fmt:formatNumber value="${num}" type="number"/>
    
    整数显示:
    <fmt:formatNumber value="${num}" pattern="#" type="number"/>
    
    两位小数舍入显示:
    <fmt:formatNumber value="${num}" pattern="#.##" type="number"/>
    
    两位小数舍入,不足两位小数补0显示:
    <fmt:formatNumber value="${num}" pattern="0.00" type="number"/>
    
    货币显示:(与number类似扩展pattern)
    <fmt:formatNumber value="${num}" type="currency"/>
    
    百分数显示:(与number类似扩展pattern)
    <fmt:formatNumber value="${num}" type="percent"/>
    
    1.2 jstl标签库与EL标签库
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    
    //数据回显
    <select name="Longflag" class="combox">
        <option value="0" ${0 eq been.longflag ? 'selected="selected"' : ''}>临时</option>
        <option value="1" ${1 eq been.longflag ? 'selected="selected"' : ''}>长期</option>
    </select>
    
    <select name="Longflag" class="combox">
        <option value="0" <c:if test="${0 eq been.longflag}">selected</c:if> >临时</option>
        <option value="1" <c:if test="${1 eq been.longflag}">selected</c:if> >长期</option>
    </select>
    
    //条件标签
    <c:if test='${flag == 1}'></c:if>	//错误写法 test='${} ' 后有空格
    <c:choose>
        <c:when test='p1.test_type.equals(p.test_type) and p1.test_item.equals(p.test_item)'></c:when>
        <c:when test=''></c:when>
        <c:otherwise></c:otherwise>
    </c:choose>
    
    //循环标签
    <c:foreach item='${performanceList}' var='performance'></c:foreach>
    
    
  • 相关阅读:
    【EXCEL】乱数関数集合
    PHP 获取当前时间前52周 12个月 4个季度
    python 清理没有过期时间的redis
    yii2 使用mongo查询(包含like查询)
    crontab 时间详解
    安装 cronsun
    php的加密&解密 (压缩数据) gzcompress & gzuncompress
    三数之和
    贪心算法解决集合覆盖问题
    KMP算法实现字符串匹配
  • 原文地址:https://www.cnblogs.com/itzlg/p/10871016.html
Copyright © 2011-2022 走看看