找不到 "http://www.atg.com/taglibs/json" 的标记库描述符

Can not find the tag library descriptor for "http://www.atg.com/taglibs/json"

我正在尝试将 JSON 标签库用于我的 JSP 页面,但出现此错误

Can not find the tag library descriptor for "http://www.atg.com/taglibs/json"

我添加了标签库,

<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>

我正在使用环境Java 1.8

如果我能以任何其他方式解析 JSP 中的 JSON 数据,请给我任何建议。

我已经添加了截图,请看下面,

添加这个:-

<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %> 
 and 
<%@page import="com.google.gson.JsonObject"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
import="org.json.JSONObject,org.json.JSONException,java.util.*"%>

在您 Jsp 页面的顶部。

最后,我发现 problem.It 缺少 JSON-taglib 依赖项。

您需要添加以下依赖,

<!-- https://mvnrepository.com/artifact/atg.taglib.json/json-taglib -->
<dependency>
    <groupId>atg.taglib.json</groupId>
    <artifactId>json-taglib</artifactId>
    <version>0.4.1</version>
</dependency>

如果您收到类似缺少工件的错误,只需从下方下载 jar 和 pom 文件 link 并将其放入您的 c:\users\.m2 文件夹

JSON-taglib files