发表于: 2017-08-27 20:58:10
1 967
今天完成的事情:
整理之前写好的task5项目,我之前写的是用class="btn btn-sm btu-success"来表示成功后跳转页面, 现在可以使用今天新学的JSTL来作为另一种判定方法:
<c:if test="${empty error}">
<font color="red"><c:out value="${error}"/></font>
</c:if>
然后写了一波学校考试的卷子,等一个复盘评审.
明天计划的事情:
进行复盘评审,学习打tag包
遇到的问题:
标签好多...看得有点晕
收获:
了解JSTL
然后在web.xml文件中添加配置
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
<taglib-location>/WEB-INF/fmt-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
<taglib-location>/WEB-INF/c-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
<taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
<taglib-location>/WEB-INF/x-rt.tld</taglib-location>
</taglib>
</jsp-config>
使用任何库,必须在每个JSP文件中的头部包含<taglib>标签
标签 | 描述 |
---|---|
<fmt:formatNumber> | 使用指定的格式或精度格式化数字 |
<fmt:parseNumber> | 解析一个代表着数字,货币或百分比的字符串 |
<fmt:formatDate> | 使用指定的风格或模式格式化日期和时间 |
<fmt:parseDate> | 解析一个代表着日期或时间的字符串 |
<fmt:bundle> | 绑定资源 |
<fmt:setLocale> | 指定地区 |
<fmt:setBundle> | 绑定资源 |
<fmt:timeZone> | 指定时区 |
<fmt:setTimeZone> | 指定时区 |
<fmt:message> | 显示资源配置文件信息 |
<fmt:requestEncoding> | 设置request的字符编码 |
标签 | 描述 |
---|---|
<sql:setDataSource> | 指定数据源 |
<sql:query> | 运行SQL查询语句 |
<sql:update> | 运行SQL更新语句 |
<sql:param> | 将SQL语句中的参数设为指定值 |
<sql:dateParam> | 将SQL语句中的日期参数设为指定的java.util.Date 对象值 |
<sql:transaction> | 在共享数据库连接中提供嵌套的数据库行为元素,将所有语句以一个事务的形式来运行 |
以及
评论