当 Servlet 响应是使用 Oracle 报表服务器生成的 pdf 时,保存它
我的应用程序部署在Oracle的OAS(ADF环境)上。我的申请是一个带有提交按钮的简单表单。单击它时,我向 Oracle 的报告服务器发送请求(到 rwservlet)。我的请求如下所示:
http://<server>:<port>/reports/rwservlet?report=<report_name>&userid=<userid>/<password>@<connect_string>&desformat=pdf&destype=cache
这会生成 PDF 报告并返回到用户的浏览器。我想获取 PDF 报告并将其保存到我的本地服务器(所以我有 2 个服务器:OAS 服务器和报告服务器 - 我在报告服务器上调用报告并返回到客户端。我只是想要拦截该进程并将报告保存在OAS服务器上)。
为了发送请求,我在 OAS 服务器上使用了 servlet。我想以某种方式从我的响应对象中获取 PDF(这是我的计划)。我不知道这是否可能。
My application is deployed on Oracle's OAS (ADF environment). My application is a simple form with a submit button. When it's clicked I send a request the Oracle's report server (to the rwservlet). My request look something like this:
http://<server>:<port>/reports/rwservlet?report=<report_name>&userid=<userid>/<password>@<connect_string>&desformat=pdf&destype=cache
This generates a PDF report and returns to the user's browser. I'd like to get that PDF report and save it to my local server as well (so I have 2 servers: the OAS server and the Reports Server - and I called the report on the Reports server and return to the client. I just want to intercept the process and save the report on the OAS server).
To send the request, I used a servlet on my OAS server. I want to somehow get the PDF from my response object (that's my plan). I don't know if this is possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法拦截/复制客户端的请求。您必须通过另一个 HTTP 请求以编程方式请求它。
只需按照通常的 Java IO 方式将其写入任意
OutputStream
即可。例如,FileOutputStream
。You can't intercept/copy client's request. You've to request it programmatically with another HTTP request.
Just write it to an arbitrary
OutputStream
the usual Java IO way. For example, aFileOutputStream
.