views:

71

answers:

1

Is it possible to create a simple server in Java that returns a response based on a given key?

So it would be a simple program, that stores a hashmap and returns the result based on a key provided by the client.

What would be the fasted implementation, to have it over HTTP or a socket? The client will be a web based application.

A: 

No should describe your environment a little better in order to get a qualified answer. Client is a web based application, thats all we know.

You could provide a servlet and add your hashcode as a request parameter. The servlet will do a lookup and return the requested object using JSON, this can be parsed in your web based application from javascript.

A tutorial for prototype and one for jQuery (which seems more popular).

stacker