我将 .jasper 文件放在我项目的web内容文件夹中,在我的操作类中只有execute方法,而我的 struts.xml 有以下代码:< / p>
<action name="myJasperTest" class="com.acme.test.action.JasperAction">
<result name="success" type="jasper">
<param name="location">/our_jasper_template.jasper</param>
<param name="dataSource">myList</param>
<param name="reportParameters">reportParams</param>
<param name="format">PDF</param>
</result>
<result name="error">/Error.jsp</result>
</action>
在运行此程序时,它给了我错误:
java.lang.ClassCastException: cannot assign instance of
net.sf.jasperreports.engine.base.JRBaseStyle to field
net.sf.jasperreports.engine.base.JRBaseParagraph.paragraphContainer of type
net.sf.jasperreports.engine.JRParagraphContainer in instance of
net.sf.jasperreports.engine.base.JRBaseParagraph
有人可以帮我解决这个问题吗?
答案 0 :(得分:1)
由于项目lib文件夹中的jar文件不正确而发生此错误