简体   繁体   English

使用JMS向客户端显示消息

[英]display messages to the client using JMS

is there any way to display messages on the JMS Queue to the client JSP ? 有什么方法可以在JMS队列上向客户端JSP显示消息?

so if any message inserted into the Queue (MessageDrivenBean) , it will shows to the client (browser) ,, 所以如果有任何消息插入到Queue(MessageDrivenBean)中,它会显示给客户端(浏览器),

thank you .. 谢谢 ..

u cannot sent the message to a jsp directly. 你不能直接将消息发送到jsp。 means u will have no idea when the message will come right so it is async way of communication. 意味着你不知道什么时候信息会正确,所以它是异步的沟通方式。 In a jsp u can have a ajax component wherein we can poll to the backend system and get populate the messages recieved in a given point of time in intervals. 在一个jsp中,您可以具有一个ajax组件,我们可以在其中轮询后端系统,并在给定的时间间隔内填充收到的消息。

You Could create a servlet or JSP that responds to some user action like a button click or page refresh and calls the bean to see if there are any in the Queue. 您可以创建一个Servlet或JSP,以响应某些用户操作,例如单击按钮或刷新页面,并调用Bean以查看队列中是否有任何内容。 You could also call a method in the bean from the servlet that returns the number in queue, etc. 您还可以从servlet中调用bean中的方法,该方法返回队列中的数字等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM