A skeleton REST endpoint
Technologies used:
- Jersey for JAX-RS
- Guice for dependency injection
- Hibernate for ORM
- Maven for dependency mgmt
- Jetty for servlet container & HTTP server
Details to fill:
Filename | Value to override |
---|---|
pom.xml | 'artifactId' value |
'finalName' value | |
log4j.properties | log4j.appender.file.File value (absolute path to file) |
persistence.xml | hibernate.connection.url (default values for MySQL, requires host, port & DB name) |
'persistence-unit' name attribute |
To compile:
mvn clean package
To run (an embedded Jetty instance):
mvn exec:java -Dexec.mainClass="Main"
To debug (w/remote debugger):
mvnDebug exec:java -Dexec.mainClass="Main"
When running on embedded Jetty, open this address in your browser:
Otherwise, copy the .war to your /webapps directory and go to whatever your standard Jetty deployment address is, appended with /undREST/msg
This was pieced together mostly from the Guice Wiki and this Randomized Sort posting.