Skip to content

Commit

Permalink
Update documentation (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermocalvo authored Dec 21, 2023
1 parent a0b25b7 commit 15aa4cd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/en/guide/theWebLayer/urlmappings/mappingToResponseCodes.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Grails also lets you map HTTP response codes to controllers, actions or views. Just use a method name that matches the response code you are interested in:
Grails also lets you map HTTP response codes to controllers, actions, views or URIs. Just use a method name that matches the response code you are interested in:

[source,groovy]
----
Expand All @@ -20,6 +20,17 @@ static mappings = {
}
----

You can also specify custom URIs:

[source,groovy]
----
static mappings = {
"403"(uri: "/errors/forbidden")
"404"(uri: "/errors/notFound")
"500"(uri: "/errors/serverError")
}
----


==== Declarative Error Handling

Expand Down

0 comments on commit 15aa4cd

Please sign in to comment.