Spring restfull webservice supporting both XML and JSON as response body.
-
run as > run on server-> this did not always seem to work (spring sts exited every time I started the server) -
I added the maven jetty plugin and now you can can start the app in the jetty webserver with the following maven command:
$ mvn jetty:run- when running on tomcat or you chose
run on server
$ curl -u remote:remote -v -H "Accept: application/xml" http://localhost:8080/SpringRestfullWSTest/contact/listdata$ curl -u remote:remote -v -H "Accept: application/json" http://localhost:8080/SpringRestfullWSTest/contact/listdata- when runnin on jetty via maven the context root is not mentioned in the url:
$ curl -u remote:remote -v -H "Accept: application/xml" http://localhost:8080/contact/listdata$ curl -u remote:remote -v -H "Accept: application/json" http://localhost:8080/contact/listdata - just run the maven test:
$ mvn test(restart server for each tests, since delete occurs in db ...)