【问题标题】:Can't parse XML through JSTL using Google App Engine无法使用 Google App Engine 通过 JSTL 解析 XML
【发布时间】:2015-04-04 03:35:44
【问题描述】:

运行我的代码后,我收到以下错误:

HTTP 错误 500

访问 /index.jsp 时出现问题。原因:

java.lang.NoClassDefFoundError: org/apache/xpath/XPathException

我在 index.jsp 文件中正确声明了标记库:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>

这里是我尝试解析 XML 文件的地方:

<select class="form-control" style="width:40rem;">
    <!-- Open Data -->
    <c:import var="sportInfo" url="http://data.nantes.fr/api/publication/24440040400129_NM_NM_00024/LOC_EQUIPUB_SPORT_NM_STBL/content/?format=xml"/>
    <x:parse xml="${sportInfo}" var="output"/>
    <x:forEach select="$output/document/data/element/geo/name" var="item">
        <option value="$output/document/data/element/_IDOBJ"><x:out select="$item" /></option>
    </x:forEach>
</select>

我已经在网上查了一下,尝试了不同的解决方案,包括将 Xalan 添加到我的项目的构建路径中,但到目前为止还没有结果。

提前致谢。

【问题讨论】:

    标签: xml jsp google-app-engine xpath jstl


    【解决方案1】:

    如果您确定类路径中存在适当的 Jars,这可能表明 XPath 和 GAE 之间存在不兼容性(AKA Xpath 使用的某些类不是 white listed)。

    有几个未解决的问题(herehere)来自与您完全相同的问题的人,这两个问题都已被 GAE 团队确认,但遗憾的是到目前为止还没有解决方案。

    【讨论】:

      猜你喜欢
      • 2016-12-25
      • 2013-08-21
      • 2011-06-01
      • 2012-04-07
      • 1970-01-01
      • 2020-07-14
      • 2015-08-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多