一次单击即可使用多项操作.

编程入门 行业动态 更新时间:2024-10-28 01:20:01
本文介绍了一次单击即可使用多项操作.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

实际上,我正在下载要显示在页面上的pdf文件,而我正在使用该servlet使用该URL来下载该pdf文件. 下载完成后,pdf文件将显示在jsp中. 但是由于下载需要一些时间,因此我想在另一个jsp中显示一些自定义消息,直到下载继续进行,并且在pdf下载完成后,我将显示pdf文件. 有什么方法可以做到吗? 请给我一些建议...对我会有很大帮助.

Actually I am downloading a pdf file to be displayed on the page for which I am using a servlet that uses the URL to download the pdf file. After download is complete the pdf file is displayed in the jsp. But as the download takes some time I want to display some custom message in another jsp until the download is going on and after the download of pdf is complete I will show the pdf file. Is there any method of doing it? Please suggest me something...It will be a great help to me.

推荐答案

我建议您使用观察者和可观察的设计模式. 您的jsp页面将是Obsorvers. 观察者应订阅发生已定义事件时要触发的Observable对象. 下载pdf文件的线程将是可观察的. 线程下载完成后,应将其触发,以使他们可以修改其显示. 看看这篇文章,对Observer设计模式有一个了解: Observer_pattern [ ^ ] 最好的问候. EL GAABEB. Hi, I suggest you to use observer and observable design patterns. Your jsp page would be the Obsorvers. Obervers should subsribe to the Observable objects to be fired when an defined event occurs. Thread downloading the pdf File would be the Observable. When the thread finish downloading it should fire it obervers so they could modify their display. look at this article to have an idea about Observer design pattern : Observer_pattern[^] Best regards. EL GAABEB.

更多推荐

一次单击即可使用多项操作.

本文发布于:2023-10-26 08:10:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529592.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多项   单击   操作

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!