- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个服务器端代码作为
@POST
@Path("/getJasperPrint")
public JasperPrint getReport(ReportMapper reportMapper,@Context HttpServletRequest request,@Context HttpServletResponse response) throws Exception{
jasperPrint = JasperFillManager.fillReport(jasperReport, reportMap,
DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb" + "?user=" + "admin" + "&password=" + "admin"));
return jasperPrint ;
}
我正在尝试使用 RestTemplate 作为
RestTemplate abc = new RestTemplate();
JasperPrint jasperPrint = abc.postForObject("http://localhost:8008/report/getJasperPrint", objectA, JasperPrint.class);
报错
no suitable HttpMessageConverter found for response type [class path to jasperPrint].
我需要在这里做的任何事情。
最佳答案
Objects passed to and returned from the methods getForObject(), postForLocation(), and put() and are converted to HTTP requests and from HTTP responses by HttpMessageConverters.
我认为您需要编写自己的转换器才能获得 jasperprint 的响应
关于java - 试图取回 JasperPrint 作为服务器的返回类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26840802/
我有一个服务器端代码作为 @POST @Path("/getJasperPrint") public JasperPrint getReport(ReportMapper r
我使用 Java 通过 JasperReports 创建报告。我想要做的是用户能够直接打印,而无需打印对话框。 我创建了 JasperPrint 并且我知道我的打印机的名称和型号。 我也查看了 sam
jasperPrint 对象是纵向的,但是 jasperPrint2 对象是横向的。我想将两个 jasperprints 结合起来生成一个 pdf 文件,但保持它们的原始方向。当我将 jasperPr
我有一个不同的问题......我用谷歌搜索了一下但没有找到任何关于我的问题的信息所以我在这里问......我有一个对象 JasperPrint,我在其中生成文档...问题是我需要从这个 JasperP
我在java中使用jasper报告(xmx=4096m)。我使用 JRGzipVirtualizer 从 PGSQL 数据库创建了一个包含 200,000 行的巨大报告。 。虚拟器在内存中占用大约 7
我有一个报告,基本上是一个带有多个空字段和程序生成的序列号的表单。目前,用户只能按时间获取其中一份,因此我希望用户可以选择所需的副本数量,然后,JasperViewer 在一个窗口中显示所有副本,而不
我正在尝试获取 JRPrint 对象,因此代码如下: import java.io.File; import net.sf.jasperreports.engine.*; public class T
我正在加载 JasperPrint 文件,加载一个 60KB 的文件大约需要 2 秒。 String jpXML = .....; InputStream is = new ByteArrayInpu
我最近遇到了一个会计 Web 应用程序的问题,该应用程序最近使用 Jasper Reports 进行了打印增强。作为会计应用程序,已决定将其部署到会计工作站,这是一台 Mac Book Pro 笔记本
我在 Ubuntu 11 上运行此代码时遇到错误: JasperReport jasperReport = JasperCompileManager.compileReport("/resources
我在运行在 rmi 注册表中注册的服务器应用程序时遇到问题。在Remote接口(interface)中,我有返回JasperPrint的方法。服务器调用时抛出异常: server = (Server)
我是一名优秀的程序员,十分优秀!