gpt4 book ai didi

java - 即使包含所有必需的 jar 后,斐济图表也会遇到异常

转载 作者:行者123 更新时间:2023-12-01 05:54:39 24 4
gpt4 key购买 nike

我的要求是根据从数据库检索的数据动态填充图表。包含的 jar 如下:

flamingo-service-jsf-1.6.1-SNAPSHOT.jar
amf-serializer-1.6.1-SNAPSHOT.jar
common-annotations.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
el-api-1.0.jar
el-impl-1.0.jar
fiji-api-1.0.0.jar
fiji-ui-1.0.0.jar
jsf-api-1.2_09.jar
jsf-facelets-1.1.14.jar
jsf-impl-1.2_09.jar
jstl-1.2.jar
laguna.jar
richfaces-api-3.2.2.CR3.jar
richfaces-impl-3.2.2.CR3.jar
richfaces-ui-3.2.2.CR3.jar
standard.jar

我的Bean如下:

import java.util.ArrayList; 
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Random;


public class GraphBean {

private Integer data;
private Map<String, Integer> monthMap = new LinkedHashMap<String,Integer>();
private ArrayList<String> names = new ArrayList<String>();
private ArrayList<String> colors = new ArrayList<String>();
Random rnd = new Random(new Date().getTime());

public GraphBean() {
super();
generateData();
}

private void generateData() {
monthMap.put("January", getData());
monthMap.put("February", getData());
monthMap.put("March", getData());
}

public Map<String, Integer> getMonthMap() {
return monthMap;
}

public ArrayList<String> getNames(){
names.add("Motherboards");
return names;
}

public ArrayList<String> getColors(){
colors.add("#5db2c2");
return colors;
}

public Integer getData() {
data = rnd.nextInt(50);
return data;
}
}

我的jsp页面如下:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> 
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://exadel.com/fiji" prefix="fiji" %>

<html>
<head>
<title>enter your name page</title>
</head>
<body> <f:view>
<fiji:columnChart id="columnChartOne" value="#{GraphBean.monthMap}" title="One-series Column Chart" barCaption="none"
barColors="#{GraphBean.colors}" captionX="Months" captionY="Amount" toolTipValue="{y} {name} are sold in {x}"
subtitle="Hardware sales per month" width="400" height="400">
<fiji:chartData type="name" value="#{GraphBean.names}" />
</fiji:columnChart>
</f:view>
</body>
</html>

执行任一执行后的页面时。

1. org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
2. org.apache.jasper.JasperException: The absolute uri: http://exadel.com/fiji cannot be resolved in either web.xml or the jar files deployed with this application

请给我一个解决方案。在过去的两周里,我正在尝试使用 jsf 标签在我的 jsp 页面中创建动态图表。

最佳答案

来自this article :

...
In the next step you are going to copy JAR files from lib folder to fiji/web/WEB-INF/lib directory
1. If running Tomcat 5.5, copy all files
2. If you are running Tomcat 6, copy all files except:
* el-api.1.0.jar
* el-impl-1.0.jar

您是否在 web.xml 文件中配置了 taglib?喜欢:

<taglib>
<taglib-uri>http://exadel.com/fiji</taglib-uri>
<taglib-location>/WEB-INF/lib/jstl-1.2.jar</taglib-location>
</taglib>

如果是这样,请尝试对其进行评论,如“不需要其他内容”一文中所示:

...
That's it. Nothing else is needed, not even changes to web.xml

关于java - 即使包含所有必需的 jar 后,斐济图表也会遇到异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3441266/

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