This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I am planning a small game project but I'm not sure which way to do it.
My programming knowhow is limited, I feel most comfortable with Java. That's why I prefer it for the serverside.
The game itself:
2 players playing in browser, boardgame similar to chess (no artificial intelligence). What I basically need is to drag and drop pieces into squares (positions) and the gameserver should tell me if that move is allowed or not.
I played around a little with struts2 and struts2jquery. Is that a good approach? any recommendations to do it differently? HTML5 also has drag and drop but how would I call java methods from html tags?
You could send an asynchronous request to the server using jQuery. The server can then interpret the request, do game checking and communicate with the opponent, etc. When the server is done, it can send a response in some format like JSON which is then read by the jQuery in your browser. I believe Spring MVC 3.0 can handle such requests and deal with JSON as well. It also has a nicer architecture than Struts2.
Joined: Jul 01, 2012
Thanks Stephan; so I'm more or less on the right track