Giter Site home page Giter Site logo

dmikurube / embedded-jetty-resteasy-guice-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from szymex/embedded-jetty-resteasy-guice-example

0.0 2.0 0.0 110 KB

Embedded-Jetty + RESTEasy + Guice example

License: Apache License 2.0

Java 100.00%

embedded-jetty-resteasy-guice-example's Introduction

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)

embedded-jetty-resteasy-guice-example's People

Contributors

dmikurube avatar szymex avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.