jstl core and jstl fn
jstl标签使用时必须加taglib:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
判定条件一般为一个EL表达式。
<c:if>并没有提供else子句,使用的时候可能有些不便,此时我们可以通过<c:choose>
tag来达到类似的目的:
<c:choose>
<c:when test="${var.index % 2 == 0}">
*
</c:when>
<c:otherwise>
*
</c:otherwise>
</c:choose>
foreach:
<c:forEach items="${userSort}" var="sort">
<td><input type="checkbox" name="usersort" value="${sort.id } ">${sort.name }</td>
</c:forEach>
EL表达式中获取list长度
在jsp页面中不能通过${list.size}取列表长度,而是
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
list的长度是:${fn:length(list)}
jstl core and jstl fn的更多相关文章
- JSTL c标签,fn标签,fmt标签 - 生活在爪洼岛上 - ITeye技术网站
jstl是sun定义的标准,由apache实现,所以要下载jar包的话去apache,要看api文档的话,去sun,API文档在此:http://java.sun.com/products/jsp/j ...
- JSTL中foreach与fn表达式
在jstl中的fn标签也是我们在网页设计中经常要用到的很关键的标签,在使用的时候要先加上头 <%@ taglib uri=" http://java.sun.com/jsp/jstl/ ...
- NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
今天调试SSM框架项目后台JSOn接口,报出来一个让人迷惑的错误:NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 上网查了一下别人的博 ...
- JSTL函数标签库 fn标签
JSTL函数标签库 fn标签 在使用jstl的函数标签库之前需要在页面中引入: <%@ taglib prefix="fn" uri="http://java.su ...
- springMVC: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
springMVC开发web的时候,报错:java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config 原因:未引入jstl ...
- J2EE中使用jstl报http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar错
一.发现问题 运行引用了jstl的jsp页面 报http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or th ...
- The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved
偶在页面里引入了标签如下: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core&q ...
- 使用Jstl异常:The absolute uri: http://java.sun.com/jsp/jstl/core cannot&nbs
错误提示是: org.apache.jasper.JasperException: This absolute uri http://java.sun.com/jsp/jstl/core ...
- java cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"
出现java cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" 主要的愿 ...
随机推荐
- 【转】 Pro Android学习笔记(七六):服务(1):local和remote
文章转载只能用于非商业性质,且不能带有虚拟货币.积分.注册等附加条件.转载须注明出处:http://blog.csdn.net/flowingflying/ Android提供服务,服务是运行在后台的 ...
- 一 Akka学习 - actor
(引用 http://shiyanjun.cn/archives/1168.html) 一: 什么是Akka? Akka是JAVA虚拟机JVM平台上构建高并发.分布式和容错应用的工具包和运行时,是一个 ...
- Python模块-configparse模块
configparse模块用来解析配置文件 配置文件 [DEFAULT] port = 3306 socket = /tmp/mysql.sock [mysqldump] max_allowed_pa ...
- 问题:C#时间差;结果:C# 使用TimeSpan计算两个时间差
C# 使用TimeSpan计算两个时间差 可以加两个日期之间任何一个时间单位. private string DateDiff(DateTime DateTime1, DateTime DateTim ...
- Eclipse调试Java程序技巧
主要步骤.Debug As"->"Java Application".双击设置断点,F5是跳进,F6是执行下一步,F7是跳出 在看这篇文章前,我推荐你看一下Ecli ...
- Could not get lock /var/lib/dpkg/lock - open 解决方法
无法获得锁 /var/lib/dpkg/lock E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily un ...
- tensorflow session会话控制
import tensorflow as tf # create two matrixes matrix1 = tf.constant([[3,3]]) matrix2 = tf.constant([ ...
- Java基础之cmd入门操作笔记
前提:jdk已安装且环境变量配置成功,参考上文jdk 安装及环境变量配置 入门操作步骤: 1.打开记事本或者notepad,编写Abc代码,具体如下: public class Abc{ pub ...
- Servlet的一些细节
由于客户端是通过URL地址访问web服务器的中的资源的,所以Servlet程序若想被外界访问,必须把servlet程序映射到一个URL地址上,这个工作在web.xml文件中使用<servlet& ...
- java多线程系列:ThreadPoolExecutor源码分析
前言 这篇主要讲述ThreadPoolExecutor的源码分析,贯穿类的创建.任务的添加到线程池的关闭整个流程,让你知其然所以然.希望你可以通过本篇博文知道ThreadPoolExecutor是怎么 ...