-
Notifications
You must be signed in to change notification settings - Fork 9
Sample Webapp
Groovity-sample-webapp is a contained but definitely non-trivial application that demonstrates many of the capabilities of groovity. The application is intended to support self-registration of users who can then authenticate to the UI via HTTP Digest auth or make API calls using HTTP Signature. Both the UI and API are used to create and retrieve "notes", which may be public or private. Hashed passwords and API keys are encrypted before being stored in the application database. The application shows how to work with both a container-managed SQL datasource via a custom context.xml for developing with the maven tomcat7 plugin, as well as a separate temporary scripted in-memory datasources for unit tests. The sample project even has a sample utility script for running groovity on the command line to test POSTing into the REST api.
The sample app also shows some best practices around project structure, e.g. web.xml configuration, as well as how to leverage packaged groovity modules like groovity-sql, groovity-crypto and groovity-servlet-admin.