-
Notifications
You must be signed in to change notification settings - Fork 4
Building and Running the Example
gsteinacker edited this page Nov 11, 2012
·
4 revisions
- Download and unpack the project
- Install Gradle
Simply run gradle build
There are two example: a "Hello World" and a slightly larger one "Shop".
In order to run one of the example, you should change into the directory and:
- Execute 'gradle jettyRun'.
- Open the example in a browser: 'http://localhost:8080/shop/storefront'
- Open the generated json-home document using a REST client: 'http://localhost:8080/shop/json-home' with Request Header 'Accept: application/json' or 'application/json-home'. The latter accept header will return a json-home document, only containing the elements defined by the (draft) specification, using application/json MAY return more data in addition to the specification.
The Json-Home project contains three modules:
- jsonhome-core: a library containing a simple domain model, representing the resources of a web application.
- jsonhome-generator: base classes used to build json-home generators.
- jsonhome-spring: the Spring controllers used to build a Spring-based web application. Contains a Spring-MVC implementation of a JsonHomeGenerator.
- jsonhome-examples/helloworld: a minimal Spring-based web application, showing the usage of jsonhome-core and jsonhome-spring.
- jsonhome-examples/shop: a very basic shop-like application, having more resources and different representations. This example also shows how to integrate jsonhome into an application that is using Freemarker templates.