Skip to content

Commit

Permalink
Merge pull request #282 from anshbansal/patch-10
Browse files Browse the repository at this point in the history
Fix for Config.groovy being replaced in the section "Content negotitation"
  • Loading branch information
graemerocher committed Jun 29, 2015
2 parents ef69e04 + 726afd2 commit 9590fb5
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/en/guide/theWebLayer/contentNegotiation.gdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,36 @@ Grails has built in support for [Content negotiation|http://en.wikipedia.org/wik

h4. Configuring Mime Types

Before you can start dealing with content negotiation you need to tell Grails what content types you wish to support. By default Grails comes configured with a number of different content types within @grails-app/conf/Config.groovy@ using the @grails.mime.types@ setting:
Before you can start dealing with content negotiation you need to tell Grails what content types you wish to support. By default Grails comes configured with a number of different content types within @grails-app/conf/application.yml@ using the @grails.mime.types@ setting:

{code:java}
grails:
mime:
types:
all: '*/*'
atom: application/atom+xml
css: text/css
csv: text/csv
form: application/x-www-form-urlencoded
html:
- text/html
- application/xhtml+xml
js: text/javascript
json:
- application/json
- text/json
multipartForm: multipart/form-data
rss: application/rss+xml
text: text/plain
hal:
- application/hal+json
- application/hal+xml
xml:
- text/xml
- application/xml
{code}

The setting can also be done in @grails-app/conf/application.groovy@ as shown below:

{code:java}
grails.mime.types = [ // the first one is the default format
Expand Down

0 comments on commit 9590fb5

Please sign in to comment.