Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
REST support for Webbit based on JAX-WS (JSR 311)
Java JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
src
.gitignore
Makefile
README.md
package.fig
pom.xml

README.md

OBSOLETE

THIS PROJECT IS NO LONGER MAINTAINED. PLEASE SEE https://github.com/webbit/webbit-rest FOR A MORE RECENT ALTERNATIVE.

Webbit REST

Webbit REST brings JAX-RS (JSR-311) to Webbit. Here is a quick example:

package org.webbitserver.rest;

import org.webbitserver.WebServer;
import org.webbitserver.WebServers;
import org.webbitserver.rest.resteasy.ResteasyHandler;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

public class Main {

    @Path("/hello")
    public static class HelloResource {
        @GET
        @Produces("text/plain")
        public String get() {
            return "Hello";
        }
    }

    public static void main(String[] args) throws Exception {
        WebServer webServer = WebServers.createWebServer(9877);
        webServer.add(new ResteasyHandler(new HelloResource()));
        webServer.start();

        System.out.println("Try this: curl " + webServer.getUri() + "hello");
    }
}

Webbit-REST uses RestEasy under the hood.

Something went wrong with that request. Please try again.