A basic project to get you started with Jersey.
We can get responses in plain text and JSON. We can also store and retrieve JSON via HTTP to a MapDB.
mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-grizzly2 -DarchetypeGroupId=org.glassfish.jersey.archetypes -DgroupId=de.gb -DartifactId=rest101 -Dpackage=de.gb.rest -DarchetypeVersion=2.25.1
mvn clean package exec:java
curl -v -H "Accept:text/plain" http://localhost:8080/myapp/gotit
Or make your browser go to: http://localhost:8080/myapp/gotit
curl -v -H "Accept:application/json" http://localhost:8080/myapp/gotit
curl -v -X PUT -H "Content-Type:application/json" -d '{"message":"Hello World"}' http://localhost:8080/myapp/gotit/1
curl -v --header "Accept:application/json" http://localhost:8080/myapp/gotit/1