gpt4 book ai didi

java - 在 Eclipse 中查看 JSP 页面中的 BIRT 报告时出现错误 404

转载 作者:行者123 更新时间:2023-12-01 16:35:47 25 4
gpt4 key购买 nike

我正在尝试在 JSP 中运行 BIRT 报告,如下 The BIRT documentation几乎一切都工作正常:在预览中可以正确查看报告,但是当我尝试运行项目并在 JSP 中显示报告时,出现 404 错误未找到。web.xml:


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="4.0"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>MktPortal</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>/birt.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/birt.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>

viewReport.jsp:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<birt:viewer id="birtViewer" reportDesign="v_venditedispre.rptdesign"
pattern="frameset" height="450" width="700" format="html">
</birt:viewer>
</body>
</html>

这是错误: 404 error

最佳答案

BIRT 将需要 BIRT 运行时来呈现 rptdesign 文件。您使用的 Taglib 不包含运行时本身。

要正确测试它,只需下载 BIRT 运行时 war 文件并部署到 Web 服务器中,并将 rptdesign 文件放入正确的路径中,然后尝试渲染它。

BIRT 运行时的链接:http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4.8.0-201806261756/birt-runtime-4.8.0-20180626.zip

将运行时部署到同一个 Web 服务器后,它将开始工作。此外,建议将报告与核心应用程序代码分开。这显然意味着创建一个目录来存储所有报告并指向该目录来选择报告文件。

关于java - 在 Eclipse 中查看 JSP 页面中的 BIRT 报告时出现错误 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61951255/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com