I want to send some HTML form data to a program I've written in Java. I'm intending to use AJAX to send the data and add some classes to my Java-code to have it behave as an http-server. So far I've always used php for things like these, but I'm new to both AJAX and setting up http servers. I've looked on-line for guides but most pages are either not similar enough to what I'm doing or just too confusing for a beginner like me.
Can someone show me a basic example of (1) sending a form element with AJAX and (2) retrieving that data in Java? Even a link to a decent guide (that show both) would be appreciated.
I know there are examples out there that show how to do (1), but I can't seem to test the client without a working server, and vice versa.
I'm also unsure of which server solution to implement in Java. I've ready guides suggesting Jetty, others Simple, and then others suggesting websocket is the way forward. I'm undecided of how to proceed.
As for (2), I assume that you'd have to somehow extract the data from the http request? How to do this?
I'm not looking for a full solution, nor a specific answer. Just something to get me started (be it code or a guide) but that's relative to what I want to do. Cheers.