Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

#11 docs

  • Loading branch information...
commit 07ee07ebacab2eb6ada1c568a4cd1bd110538c86 1 parent 49e2bda
robfletcher authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 readme.md
View
9 readme.md
@@ -312,6 +312,14 @@ The plugin supports a few configurable options. Where equivalent configuration a
* **grails.converters.gson.dateStyle** and **grails.converters.gson.timeStyle** specify the style used to format `java.util.Date` objects in serialized output. See [`GsonBuilder.setDateFormat(int, int)`][24]. The values should be one of the `int` constants - `SHORT`, `MEDIUM`, `LONG` or `FULL` - from [`java.text.DateFormat`][25]. Note that Gson does not have a way to specify a _locale_ for the format so [`Locale.US`][26] is always used. For more control over the format use _grails.converters.gson.datePattern_ or register a custom `TypeAdapterFactory`.
+## RESTful controllers with GSON
+
+The GSON plugin includes a scaffolding template for RESTful controllers designed to work with Grails' [resource style URL mappings][27]. To install the template run:
+
+ grails install-gson-templates
+
+This will overwrite any existing file in `src/templates/scaffoldng/Controller.groovy`. You can then generate RESTful controllers that use GSON using the normal dynamic or static scaffolding capabilities.
+
## Version history
### [1.0.1](https://github.com/robfletcher/grails-gson/issues?milestone=2)
@@ -351,3 +359,4 @@ Initial release.
[24]:http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/GsonBuilder.html#setDateFormat(int, int)
[25]:http://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html
[26]:http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#US
+[27]:http://grails.org/doc/latest/guide/single.html#REST
Please sign in to comment.
Something went wrong with that request. Please try again.