Initial commit of sample java rest server
6 files changed
tree: 14f5dab21933e569b334a05397c79da76e18b5e5
  1. authentication/
  2. rest/

Booking Server (REST) Skeleton for Java

This ia a reference implementation for API v3 Booking server based on:


Require installations of

Get Started

  1. Copy the Proto Interface into a proto file (api_v3.proto). Modify the package to match your project (com.partner.mapsbooking.v3.model).

  2. Create a web application project in your IDE named booking_server_v3, add Maven support to this project.

  3. Place your proto file under the src/main/resources, add dependencies for Jersey and protocol buffers runtime to the Maven pom.xml file:

  4. Execute the following command under src/main to auto-generate a source file for the classes defined in the proto file:

     protoc --java_out=java resources/api_v3.proto
  5. Inside of the src/main/java, create a new package matching your groupId (com.partner.mapsbooking). Retrieve the sample code from the repo, place the files under your package, follow the TODOs to complete your implementation.

  6. Configure your servlet by modifying the web.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns=""
            <servlet-name>Booking Rest Server</servlet-name>
            <servlet-name>Booking Rest Server</servlet-name>
  7. In the Run Configurations, set up a Tomcat server configuration. Add all the jars to the /WEB_INF/lib directory (project structure -> artifacts -> After selecting all jars right click and choose “Put into /WEB-INF/lib”).

  8. Run Tomcat to start your server.

Final Directory Structure