在jsp中使用jstl标签时出现的问题:
我的xml文件是:
==============
<?xml version="1.0" encoding="UTF-8"?>
<users>
<user id ="1">
<sex>男</sex>
<name>张三</name>
<age>xx</age>
<add>四川江油</add>
</user>
<user id = "2">
<sex>男</sex>
<name>李四</name>
<age>xx</age>
<add>四川广安</add>
</user>
<user id = "3">
<sex>男</sex>
<name>王五</name>
<age>xx</age>
<add>江西永新</add>
</user>
<user id = "4">
<sex>男</sex>
<name>刘六</name>
<age>xx</age>
<add>湖南永州</add>
</user>
</users>
===========================================
在jsp页面中使用是:
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
<html>
<head>
<title> <jstl > study</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
输出XML文件标签 x:out 用法举例:<hr>
<x:parse var="users" scope="application">
<c:import url="users.xml" charEncoding="GBK" />
</x:parse>
学生:(id=001):</br>
<x:out select="$users/user@[id=4]" /></br>
</body>
</html>
==========================
问题:通过以上使用时浏览器会报一个错误是:
org.xml.sax.SAXParseException: The element type "sex" must be terminated by the matching end-tag "</sex>".
=================================
但是我检测了好几次有那个结束的</sex>啊
请问各位大虾们 ,问题是出自哪里呢?
==============
<?xml version="1.0" encoding="UTF-8"?>
<users>
<user id ="1">
<sex>男</sex>
<name>张三</name>
<age>xx</age>
<add>四川江油</add>
</user>
<user id = "2">
<sex>男</sex>
<name>李四</name>
<age>xx</age>
<add>四川广安</add>
</user>
<user id = "3">
<sex>男</sex>
<name>王五</name>
<age>xx</age>
<add>江西永新</add>
</user>
<user id = "4">
<sex>男</sex>
<name>刘六</name>
<age>xx</age>
<add>湖南永州</add>
</user>
</users>
===========================================
在jsp页面中使用是:
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
<html>
<head>
<title> <jstl > study</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
输出XML文件标签 x:out 用法举例:<hr>
<x:parse var="users" scope="application">
<c:import url="users.xml" charEncoding="GBK" />
</x:parse>
学生:(id=001):</br>
<x:out select="$users/user@[id=4]" /></br>
</body>
</html>
==========================
问题:通过以上使用时浏览器会报一个错误是:
org.xml.sax.SAXParseException: The element type "sex" must be terminated by the matching end-tag "</sex>".
=================================
但是我检测了好几次有那个结束的</sex>啊
请问各位大虾们 ,问题是出自哪里呢?
...全文
相关推荐
解决IDEA中Maven项目中JSTL标签无效问题
主要介绍了关于IDEA中Maven项目中JSTL标签无效问题的解决方法,需要的朋友可以参考下
在Intellij Idea中使用jstl标签库的方法
主要介绍了在Intellij Idea中使用jstl标签库的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
解决JSTL foEach标签 刷新报错的方法
本篇文章是对JSTL foEach标签刷新报错的方法进行了详细的分析介绍,需要的朋友参考下
jstl.jar和standard.jar 报错Can not find "http://java.sun.com/jsp/jstl/
报错为:Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/
无法在web.xml或使用此应用程序部署的jar文件中解析绝对uri:[http://java.sun.com/jsp/jstl
免费下载,解压后将tld和lib文件夹放入WEB-INF下面即可,绝对有效立竿见影


Web 开发
