用Ajax技术实现B/S模式下客户端间信息交互  被引量:3

Realization of Communication among Clients under B/S Using Ajax

在线阅读下载全文

作  者:田福生[1] 张燕平[1] 

机构地区:[1]安徽大学计算智能与信号处理教育部重点实验室,安徽合肥230039

出  处:《计算机技术与发展》2007年第10期92-94,98,共4页Computer Technology and Development

基  金:安徽省自然科学基金(050420208)

摘  要:C/S模式下,客户端之间的信息交互通过Socket编程或者消息传递中间件很容易实现,而B/S模式下,作为客户端的浏览器之间的信息交互却很难实现,因为浏览器客户端对信息的改变很容易提交给服务器端,反过来,服务器端的信息的改变却很难及时地通知每个客户端,只能通过客户端重新发出HTTP请求。传统的方法是每个客户端的网页每隔一段时间就刷新一次,这势必会造成整个页面的不断刷新和重载,从而浪费时间和宽带。文中利用Ajax与服务器端交互异步的特点,结合Jsp/Servlet的强大功能,实现web页面无刷新快速更新数据方法,达到客户端与服务器端尽量保持数据同步,客户端之间通过web服务器实现了信息的交互,并且在用户体验上也得到了优化。实验结果表明,该方法具有一定的实用性。The communication among the clients can be easily realized using the Socket programming or middleware of message queue in the mode of the client/server. But it is difficult to be realized in the mode of browser/server,since the changing of clients which is browser can easily be sent to server while the changing of server could not be sent to the clients. The clients can only be modified by sending the request of HTTP again in the mode of browser/server. Traditional method is to refresh the client at regular intervals. It must lead to continuously refreshing and loading. It is a waste of time and bandwidth. In this paper,a novel method of combining the characteristic of asynchronous communication of Ajax and the strong function of Jsp/Servlet is proposed. It can achieve the high quality of synchronization between the clients and server,and realize the communication among clients by web server. The experiments reveal its applicability.

关 键 词:B/S AJAX 信息交互 

分 类 号:TP311[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象