{"id":19368634,"url":"https://github.com/ghusta/jaxrs-sample-jersey","last_synced_at":"2026-07-09T08:30:21.771Z","repository":{"id":148620669,"uuid":"110992312","full_name":"ghusta/jaxrs-sample-jersey","owner":"ghusta","description":"JAX-RS Sample : Jersey version","archived":false,"fork":false,"pushed_at":"2017-11-24T10:04:50.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T22:36:00.716Z","etag":null,"topics":["jax-rs","jersey"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghusta.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-16T16:01:50.000Z","updated_at":"2017-11-16T16:02:23.000Z","dependencies_parsed_at":"2023-05-20T17:31:23.839Z","dependency_job_id":null,"html_url":"https://github.com/ghusta/jaxrs-sample-jersey","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjaxrs-sample-jersey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjaxrs-sample-jersey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjaxrs-sample-jersey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjaxrs-sample-jersey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghusta","download_url":"https://codeload.github.com/ghusta/jaxrs-sample-jersey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240491825,"owners_count":19809977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jax-rs","jersey"],"created_at":"2024-11-10T08:07:25.473Z","updated_at":"2026-07-09T08:30:21.738Z","avatar_url":"https://github.com/ghusta.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= JAX-RS Sample : Jersey version\n:toc:\n:toc-placement: manual\n:toclevels: 2\n\nimage:https://travis-ci.org/ghusta/jaxrs-sample-jersey.svg?branch=master[\"Build Status\", link=\"https://travis-ci.org/ghusta/jaxrs-sample-jersey\"]\n\ntoc::[]\n\n== Overview\n\nSample project for testing JAX-RS 2.0 with Jersey 2.x\n\n== Project generation\n\nMaven archetype used :\n\n[source,shell]\n----\nmvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.25.1 -DgroupId=fr.husta.test.jaxrs -DartifactId=jaxrs-sample-jersey -B\n----\n\n== Run\n\nRun the webapp with :\n\n[source,shell]\n----\nmvn jetty:run\n----\n\n[NOTE]\nJetty 9 needs Java 8 !\n\n== REST with JAX-RS\n\nWhat is the use of certain HTTP headers ?\n\n=== Request Headers\n\n|===\n| HTTP Header | Use | JAX-RS Annotations | Example\n\n| `Accept`\n| Used to set the preference for the content type of the *response body*. Can have multiple values. If unsuitable, server will send a HTTP 406.\n| `@Produces`\n| application/json,application/xml\n\n| `Content-Type`\n| Used to precise the content type of the *request body*.\n| `@Consumes`\n| application/json\n|===\n\n=== Response Headers\n\n|===\n| HTTP Header | Use | JAX-RS Annotations | Example\n\n| `Content-Type`\n| Used to precise the content type of the *response body*. No header if no content.\n| Depends on `@Accept` and https://en.wikipedia.org/wiki/Content_negotiation[Content negotiation]\n| application/json\n|===\n\n== JAX-RS with Jersey\n\nI use https://jersey.github.io/[Jersey] as the https://github.com/jax-rs[JAX-RS] implementation.\n\nUp to Jersey 2.25, Java 6 and JAX-RS 2.0 (https://jcp.org/en/jsr/detail?id=339[JSR-339]) are required.\n\nAs of Jersey 2.26, there are https://jersey.github.io/documentation/latest/migration.html#mig-2.26[important changes] :\n\n- Requires Java 8\n- Use JAX-RS 2.1 (https://jcp.org/en/jsr/detail?id=370[JSR-370])\n\n== Docker\n\n=== Build an image\n\n[source,shell]\n----\ndocker build -t jaxrs-sample-jersey .\n----\n\n=== Run a container\n\n[source,shell]\n----\ndocker run -d –name jaxrs-test-1 -p 8090:8080 jaxrs-sample-jersey\n----\n\n=== Test\n\nOpen a browser on http://localhost:8090/jaxrs-sample-jersey/[http://localhost:8090/jaxrs-sample-jersey/]\n\nOr try :\n\n[source,shell]\n----\ncurl -X GET http://localhost:8090/jaxrs-sample-jersey/webapi/myresource[http://localhost:8090/jaxrs-sample-jersey/webapi/myresource]\n----\n\n_Generated with Asciidoctor {asciidoctor-version}_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghusta%2Fjaxrs-sample-jersey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghusta%2Fjaxrs-sample-jersey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghusta%2Fjaxrs-sample-jersey/lists"}