分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

jstl 使用

发布时间:2023-09-06 01:26责任编辑:胡小海关键词:js

1、需要导入:

   1)jstl.jar

   2)standard.jar

引入:jsp相应的核心库:<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>

其中preifix表示是什么标签。 url表示引用什么标签。会报错:org.apache.jasper.JasperException: /action/demo7.jsp (line: 15, column: 0) According to TLD or attribute directive in tag file, attribute test does not accept any expressions

需要更改为:http://java.sun.com/jstl/core_rt 即可解决。

格式:<c:if  test="el表达式(${xx})"> </c:if>

没有else判断,如果需要重新在写一个。

但是需要注意:引用http://java.sun.com/jstl/core

 1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 <%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> 3 <html> 4 <head> 5 ????<title>Title</title> 6 </head> 7 <body> 8 <c:if test="${2>4}">2>4</c:if> 9 <c:if test="${4>2}">4>2</c:if>10 </body>11 </html>

jstl 使用

原文地址:https://www.cnblogs.com/evilliu/p/8626748.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved