Skip to content

coopstah13/Embedded-Jetty-RESTEasy-Guice-Example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedded-Jetty + RESTEasy + Guice example

Hello world example project that integrates:

  • Jetty embedded 9.x
  • RESTEasy 3.x (JAX-RS 2.0)
  • Guice 3.0

It uses:

  • modified GuiceResteasyBootstrapServletContextListener class (injects guice injector and use that one)
  • different media types
  • gson provider
  • asynchronous requests
  • user role authorization
  • custom object to be injectable with @Context annotation
  • simple filter
  • unit tests

Usage

mvn exec:java -Dexec.args="pl"
(for polish hello world)

mvn exec:java -Dexec.args="fi"
(for finnish hello world)

Web browser or REST client

[http://localhost:8080/hello.json] (http://localhost:8080/hello.json)

[http://localhost:8080/hello] (http://localhost:8080/hello)
(Responses with 403 Forbidden)

[http://localhost:8080/hello?user=bob] (http://localhost:8080/hello?user=bob)

[http://localhost:8080/async-hello?d=2] (http://localhost:8080/async-hello?d=2)
(Responses after 2 seconds)

About

Embedded-Jetty + RESTEasy + Guice example

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%