【问题标题】:Moqui: opening an attachment instead of downloading itMoqui:打开附件而不是下载它
【发布时间】:2016-10-07 04:35:33
【问题描述】:

如何指示浏览器在新标签页中打开附件(PDF 或 JPEG)而不是下载附件?我想这是通过发送特定的响应来完成的——我找到了一个讨论设置响应参数的线程。有没有办法在 Moqui 做到这一点?

有关信息,这是上述线程: How to force files to open in browser instead of download (pdf)?

------------------添加 06.10.2016-------------- --------------

我遇到了一种奇怪的行为。

有一个带有这些参数<form-list name="InvoiceList" list="invoiceList" skip-form="false" multi="true"> 的表单列表。

在行操作中,我调用一个加载 invoiceContentLocation 的服务,如果有的话:<service-call name="mantle.account.InvoiceServicesEnhancements.get#InvoiceContentToDisplay" in-map="[invoiceId:invoiceId]" out-map="contentInfo"/>

有一个字段,一个调用转换的链接,其目的是在单独的选项卡中打开内容。这是字段:<field name="invoiceContentLocation"> <default-field title=""> <link url="openContent" condition="contentInfo.invoiceContentLocation" icon="glyphicon glyphicon-file" parameter-map="[invoiceContentLocation:contentInfo.invoiceContentLocation]" link-type="anchor-button" target-window="_blank" tooltip="Open attachment of the invoice." /> </default-field> </field>

还有过渡:<transition name="openContent" read-only="true"> <parameter name="invoiceContentLocation"/> <actions> <log message="Location ${invoiceContentLocation}." level="info"/> <if condition="invoiceContentLocation!=null"> <script>ec.web.sendResourceResponse(invoiceContentLocation, true)</script> </if> </actions> <error-response type="none"/> <default-response type="none"/> </transition>

内容总是在新标签页中正确打开,但有时会出现异常。即使对于相同的内容文件(单张发票),我也经历过这两种情况。

22:23:51.965 INFO 455896770-19 o.moqui.i.e.EntityFacadeImpl 在 19 毫秒内发现 46 个文件中的实体 22:23:51.965 INFO 455896770-19 o.moqui.i.e.EntityFacadeImpl 在数据库中找到 0 个视图实体定义(DbViewEntity 记录) 22:23:52.181 INFO 455896770-19 o.moqui.i.s.ScreenRenderImpl apps/AccountantScreen/Accounting/Invoice/FindInvoiceNAF in 359ms (text/html;charset=utf-8) session 19abbna66thi7zula8mifowqt 22:23:54.575 INFO 455896770-12 o.moqui.i.c.LoggerFacadeImpl 位置 dbresource://mantle/content/invoice/IMP_INV_918/content_100052/918_Fega_Frost_1162736029.pdf。 22:23:54.646 INFO 455896770-12 o.moqui.i.c.WebFacadeImpl 从位置 dbresource://mantle/content/invoice/IMP_INV_918/content_100052/918_Fega_Frost_1162736029.pdf 流式传输 946939 字节 22:23:54.656 INFO 455896770-12 o.moqui.i.s.ScreenRenderImpl 转换应用程序/AccountantScreen/Accounting/Invoice/FindInvoiceNAF/openContent 在 81 毫秒内,键入无响应 22:23:54.673 INFO 455896770-16 o.moqui.i.c.LoggerFacadeImpl 位置 dbresource://mantle/content/invoice/IMP_INV_918/content_100052/918_Fega_Frost_1162736029.pdf。 22:23:54.680 错误 455896770-16 o.m.i.a.XmlAction 运行 groovy 脚本时出错(org.eclipse.jetty.io.EofException): 1:导入 org.moqui.impl.StupidUtilities 2:导入java.sql.Timestamp 3 : // 这些默认在上下文中:ExecutionContext ec, Map context, Map result 4 : ec.logger.log("info", """位置 ${invoiceContentLocation}.""", null) 5 : if (invoiceContentLocation!=null) { 6: 7 : // 开始内联脚本 8 : ec.web.sendResourceResponse(invoiceContentLocation, true) 9 : // 结束内联脚本 10:} 11: 12 : // 确保最后一条语句不被视为返回值 13:返回; 14:

org.eclipse.jetty.io.EofException 在 org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:197) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:420) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:313) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:140) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:741) ~[?:?] 在 org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:521) ~[?:?] 在 org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:706) ~[?:?] 在 org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:755) ~[?:?] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor$GzipBufferCB.process(GzipHttpOutputInterceptor.java:384) ~[?:?] 在 org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor.gzip(GzipHttpOutputInterceptor.java:146) ~[?:?] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor.write(GzipHttpOutputInterceptor.java:115) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:179) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:163) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:415) ~[?:?] 在 org.moqui.impl.StupidUtilities.copyStream(StupidUtilities.groovy:268) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl.sendResourceResponseInternal(WebFacadeImpl.groovy:735) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl.sendResourceResponse(WebFacadeImpl.groovy:718) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl$sendResourceResponse.call(Unknown Source) ~[?:?] 在 FindInvoiceNAF_xml_transition_openContent_actions.run(FindInvoiceNAF_xml_transition_openContent_actions:8) ~[script:?] 在 org.moqui.impl.actions.XmlAction.run(XmlAction.groovy:66) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenDefinition$TransitionItem.run(ScreenDefinition.groovy:698) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:222) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:332) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:159) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.doScreenRequest(MoquiServlet.groovy:82) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.service(MoquiServlet.groovy:56) [moqui-framework-2.0.0.jar:2.0.0] 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [moqui.war:3.1.0] 在 org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:225) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:461) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.Server.handle(Server.java:524) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [moqui.war:9.3.11.v20160721] 在 java.lang.Thread.run(Thread.java:745) [?:1.8.0_92] 原因:java.io.IOException:已建立的连接被主机中的软件中止 在 sun.nio.ch.SocketDispatcher.writev0(Native Method) ~[?:1.8.0_92] 在 sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:55) ~[?:1.8.0_92] 在 sun.nio.ch.IOUtil.write(IOUtil.java:148) ~[?:1.8.0_92] 在 sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504) ~[?:1.8.0_92] 在 org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:177) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] ... 62 更多 22:23:54.686 WARN 455896770-16 o.moqui.i.c.TransactionFacadeImpl 事务回滚。回滚最初是由:[http://localhost:8080/apps/AccountantScreen/Accounting/Invoice/FindInvoiceNAF/openContent] 中的错误运行转换引起的 org.eclipse.jetty.io.EofException 在 org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:197) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:420) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:313) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:140) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:741) ~[?:?] 在 org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:521) ~[?:?] 在 org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:706) ~[?:?] 在 org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:755) ~[?:?] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor$GzipBufferCB.process(GzipHttpOutputInterceptor.java:384) ~[?:?] 在 org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor.gzip(GzipHttpOutputInterceptor.java:146) ~[?:?] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor.write(GzipHttpOutputInterceptor.java:115) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:179) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:163) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:415) ~[?:?] 在 org.moqui.impl.StupidUtilities.copyStream(StupidUtilities.groovy:268) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl.sendResourceResponseInternal(WebFacadeImpl.groovy:735) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl.sendResourceResponse(WebFacadeImpl.groovy:718) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl$sendResourceResponse.call(Unknown Source) ~[?:?] 在 FindInvoiceNAF_xml_transition_openContent_actions.run(FindInvoiceNAF_xml_transition_openContent_actions:8) ~[script:?] 在 org.moqui.impl.actions.XmlAction.run(XmlAction.groovy:66) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenDefinition$TransitionItem.run(ScreenDefinition.groovy:698) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:222) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:332) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:159) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.doScreenRequest(MoquiServlet.groovy:82) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.service(MoquiServlet.groovy:56) [moqui-framework-2.0.0.jar:2.0.0] 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [moqui.war:3.1.0] 在 org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:225) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:461) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.Server.handle(Server.java:524) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [moqui.war:9.3.11.v20160721] 在 java.lang.Thread.run(Thread.java:745) [?:1.8.0_92] 原因:java.io.IOException:已建立的连接被主机中的软件中止 在 sun.nio.ch.SocketDispatcher.writev0(Native Method) ~[?:1.8.0_92] 在 sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:55) ~[?:1.8.0_92] 在 sun.nio.ch.IOUtil.write(IOUtil.java:148) ~[?:1.8.0_92] 在 sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504) ~[?:1.8.0_92] 在 org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:177) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] ... 62 更多 22:23:54.693 WARN 455896770-16 o.moqui.i.c.TransactionFacadeImpl 事务回滚 [在 [http://localhost:8080/apps/AccountantScreen/Accounting/Invoice/FindInvoiceNAF/openContent]] 中运行转换时出错。这是当前位置: org.moqui.BaseException:回滚位置 在 org.moqui.impl.context.TransactionFacadeImpl.rollback(TransactionFacadeImpl.groovy:426) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.TransactionFacadeImpl.rollback(TransactionFacadeImpl.groovy:409) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:334) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:159) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.doScreenRequest(MoquiServlet.groovy:82) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.service(MoquiServlet.groovy:56) ~[moqui-framework-2.0.0.jar:2.0.0] 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[moqui.war:3.1.0] 在 java.lang.Thread.run(Thread.java:745) [?:1.8.0_92] 22:23:54.694 错误 455896770-16 o.m.i.w.MoquiServlet 内部错误处理请求:空 org.eclipse.jetty.io.EofException 在 org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:197) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:420) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:313) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:140) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:741) ~[?:?] 在 org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:521) ~[?:?] 在 org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:706) ~[?:?] 在 org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:755) ~[?:?] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor$GzipBufferCB.process(GzipHttpOutputInterceptor.java:384) ~[?:?] 在 org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224) ~[jetty-util-9.3.11.v20160721.jar:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor.gzip(GzipHttpOutputInterceptor.java:146) ~[?:?] 在 org.eclipse.jetty.server.handler.gzip.GzipHttpOutputInterceptor.write(GzipHttpOutputInterceptor.java:115) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:179) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:163) ~[?:?] 在 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:415) ~[?:?] 在 org.moqui.impl.StupidUtilities.copyStream(StupidUtilities.groovy:268) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl.sendResourceResponseInternal(WebFacadeImpl.groovy:735) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl.sendResourceResponse(WebFacadeImpl.groovy:718) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.context.WebFacadeImpl$sendResourceResponse.call(Unknown Source) ~[?:?] 在 FindInvoiceNAF_xml_transition_openContent_actions.run(FindInvoiceNAF_xml_transition_openContent_actions:8) ~[script:?] 在 org.moqui.impl.actions.XmlAction.run(XmlAction.groovy:66) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenDefinition$TransitionItem.run(ScreenDefinition.groovy:698) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:222) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:216) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:332) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:159) ~[moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.doScreenRequest(MoquiServlet.groovy:82) [moqui-framework-2.0.0.jar:2.0.0] 在 org.moqui.impl.webapp.MoquiServlet.service(MoquiServlet.groovy:56) [moqui-framework-2.0.0.jar:2.0.0] 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [moqui.war:3.1.0] 在 org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:225) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:461) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.Server.handle(Server.java:524) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [moqui.war:9.3.11.v20160721] 在 org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [moqui.war:9.3.11.v20160721] 在 java.lang.Thread.run(Thread.java:745) [?:1.8.0_92] 原因:java.io.IOException:已建立的连接被主机中的软件中止 在 sun.nio.ch.SocketDispatcher.writev0(Native Method) ~[?:1.8.0_92] 在 sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:55) ~[?:1.8.0_92] 在 sun.nio.ch.IOUtil.write(IOUtil.java:148) ~[?:1.8.0_92] 在 sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504) ~[?:1.8.0_92] 在 org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:177) ~[jetty-io-9.3.11.v20160721.jar:9.3.11.v20160721] ... 62 更多 22:23:54.699 WARN 455896770-16 o.moqui.i.c.TransactionFacadeImpl 仅在当前事务上未设置回滚,状态为 STATUS_NO_TRANSACTION 22:23:54.699 错误 455896770-16 o.m.i.w.MoquiServlet 渲染内部错误错误屏幕时出错,发送代码 500 和消息:null java.lang.RuntimeException:渲染屏幕时出错 [component://webroot/screen/webroot.xml]

【问题讨论】:

    标签: browser httpresponse moqui


    【解决方案1】:

    要查看详细信息,请查看简单的 MoquiFopServlet.groovy 文件。

    基本上,如果您传递一个“文件名”参数,那么它将添加一个带有附件和给定文件名的 Content-Disposition 标头。如果没有文件名参数,Content-Disposition 标头将是简单的内联排序,PDF 将显示在浏览器中(嗯,取决于浏览器...)。

    【讨论】:

    • 我查看了 groovy 文件。但是我使用了类似于 Invoice 的 ContentSection 的 openContent 转换中的代码。变了一点。我将它添加到我原来的问题中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多