一次单击即可使用多项操作. [英] Using Multiple operations on a single click.

查看:96
本文介绍了一次单击即可使用多项操作.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,我正在下载要显示在页面上的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.


这篇关于一次单击即可使用多项操作.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆