Question: I want to write something in Java that would compute something on the fly. So, I want to have a Java server that can reply to AJAX requests. That's all I need. I want it to be as minimalistic as humanly possible.

If you want a hypothetical scenario, pretend I want to write an adder service. Something to which I can pass the JSON: { "action" : "add", "args": [0, 1] } and get { "sum" : 1 } back. That's all, but I want it on the web. I don't care about security or anything else. So no sessions, no https or anything.

I don't want to set up a server or use some bloated framework. I'm thinking I can accomplish this with JNetPCap and pure old Java, but I would like to get rid of PCap as well. 

I guess I'm asking what in the standard JRE or a very light-weight jar can give me what I'm looking for.

Thank you guys.

Edit: For the purpose of the exercise, imagine that what I want to write should be able to run on anything that has Java installed and has an open port. 

Edit #2: It turns out my entire thought process had a fundamental flaw: If I have a server that only serves JSON there's no way to have a page on the same domain that can safely request that JSON without using JSONP or something. So, I will be using the JLHTTP. Thank you all who participated.

Answer: 
[This is](http://www.freeutils.net/source/jlhttp/) the most lightweight functioning HTTP server written in Java that I've come across so far (39 KB for the whole thing). I've used it for doing integration testing, I have no idea how it would fare as a production server. In particular, I don't know how it handles multiple concurrent requests.
I think you might be too quick to dismiss the "bloated-frameworks". What you're trying to do is implement - at the bare minimum - something capable of receiving, understanding, and responding to http GET requests using JSON for your message passing. While this can be done using code completely native to your run of the mill jdk, you would probably end up writing far more code to accomplish this, than you would if you would follow a quick tutorial on Tomcat or Jetty. That is what I'm guessing the purpose of @jcm's comment was.

But if you really want to just get this done and not think about it, all you really need to do is follow a tutorial like this one: <http://www.youtube.com/watch?v=EOkN5IPoJVs>

The video is using tomcat and eclipse. The version is an older one but its close enough that you can kind of play around and figure it out. I'm only recommending Tomcat because its what I know; but Jetty would work perfectly well as @David suggested and I'm sure there are plenty of simple tutorials out there for that as well.

Also, once you get your servlet up and going, I think you're going to find that parsing your json requests as strings is annoying. I would recommend looking into [gson](http://code.google.com/p/google-gson/). It is a really simple way to map JSON strings to POJOs.

The gist of what I'm saying is that doing this all natively with java and without any 3rd party software might be the shortest path, but not the easiest. Just like taking your car to your friends house might be a 3 mile drive, but its still easier and quicker than running 1 mile through the woods.