java tomcat6 - 如何在添加数据时自动刷新页面? [英] java tomcat6 - How to automatically refresh page when a data is added?
问题描述
您可以尝试webSockets。它是html5中的一项新功能。它允许你做全双工通信。它非常简单。你将不得不做客户端和服务器端。为了做服务器端,你需要tomcat 7.0.32。它包含一个新的WebSocketServlet。
这些链接可能会帮助你。
http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html
http://svn.apache.org/viewvc/tomcat / trunk / webapps / examples / websocket /
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/
first of all let me explain what Im tring to do. Im trying to create a very simple web based chat program. In my development I have 2 pcs using only 1 ip address. The ip address that is being used is the ip address which runs the tomcat6 server. The simple chat is connected to the database. How will I make the web page automatically update when the other pc input data(message) in the database without reloading the page.
Please forgive me if my question might sound idiotic. I have no experience in chat program. Please help.
You can try webSockets. Its a new feature in html5. It allows you to do full duplex communication. Its very simple. You will have to do both client side and server side. For doing the server side you will need tomcat 7.0.32. It contains a new WebSocketServlet. These links may help you..
http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/websocket/
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/
这篇关于java tomcat6 - 如何在添加数据时自动刷新页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!