English 中文(简体)
使用JSF的双用户井字游戏
原标题:A two-user tic tac toe using JSF
  • 时间:2012-05-25 16:30:45
  •  标签:
  • java
  • jsp
  • jsf

I m trying to write a two-user tic tac toe using JSF technology. From the books and tutorials I ve read I understand how JSF s work and how to write a web-app for one user to use, say a Celsius to Fahrenheit converter or something like that.

我在任何地方都找不到的是如何以两个用户(在不同的计算机上)实际上可以相互连接并相互玩井字游戏的方式实现该应用程序。所以我想我必须以某种方式为这两个用户授予特定Bean的访问权限,通过登录进行身份验证,但是,Bean本身必须知道哪个用户正在采取行动,这样游戏才能轮流进行。

有任何已知的方法来实现这样的东西吗?有人能给我一个关于这个话题的教程或其他东西吗?

最佳回答

您正在寻找ajax推送。标准JSF组件库并不支持它,因为到目前为止,实现依赖于servletcontainer,而JSF被设计为独立于servletcontainer。未来的Servlet 3.1规范(Java EE 7的一部分)将引入websockets支持,从而允许标准化的推送可能性。未来的JSF 3.0可能会支持它。

截至目前,除其他外,PrimeFacesJSF组件库有a<;p:push>;组件(单击链接查看实时示例),它使用Jetty在盖子下为集装箱提供服务。PrimeFaces的安装细节http://www.primefaces.org/documentation.html“rel=”nofollow“>用户指南

只需尝试PrimeFaces网站上提供的示例,您就会了解如何实现您的井字游戏想法。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签