Rolonoa
Rolonoa

Reputation: 83

How to allow interaction between Java application and user front Web interface

I need to create a user facing web interface (perhaps with HTML5 and Javascript) that allows a user to draw lines using a mouse. The interaction would involve mouse drag, clicks, etc. I need to send these inputs to a Java application on a remote machine and get back some result and update the web page the user's drawing on. So this would require a two way communication.

Since this is a proof of concept prototype, I need a solution that's easy and simple, and hopefully fast since the user would like to see the update quickly. What technology do you recommend to allow the communication between the web interface and java application? I was thinking about writing a simple server in Java and talk to the remote application using JMS... not sure this is the right direction. Thank you for your insights.

Upvotes: 1

Views: 931

Answers (4)

r0ast3d
r0ast3d

Reputation: 2635

have you tried this ? Look at the demo section on the shared canvas.

http://jwebsocket.org/

Upvotes: 1

HRgiger
HRgiger

Reputation: 2790

it can be done also using RIA: actionscript3/flash+xml socket+java server. You can handle events via actionscript3 and then send parameters to server and after receive answer. There is lot of source for as3 drawing api after you can modify for socket connection.

Upvotes: 1

hvgotcodes
hvgotcodes

Reputation: 120258

I'm not sure JMS is a good fit here.

The browser would communicate with the server the way all web-apps do, via http requests. So, on the server you would use servlets, or some frameworks that builds on top of servlets, running in the container of your choice. You webapp would periodically send an xml http request (XHR/AJAX) to update the state of the drawing. Or it would do it when the user wanted to save their design.

Keep in mind what you are describing is a Web Application. This means that an application is running in the browser, so it can maintain its own state independent of the server. It just needs to sync up every now and again. You don't need to continuously send requests to the server.

Upvotes: 1

phatfingers
phatfingers

Reputation: 10250

Any servlet container, such as Tomcat, JBoss, Jetty, GlassFish or WebSphere would do.

Upvotes: 1

Related Questions