Skip to content

Commit

Permalink
Add exception handler description in Spring web docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hantsy authored and ia3andy committed Nov 19, 2019
1 parent 44df524 commit 3b09f7d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/src/main/asciidoc/spring-web.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,29 @@ The following method return types are supported:
* POJO classes which will be serialized via JSON
* `org.springframework.http.ResponseEntity`

=== Controller method return types
=== Controller method parameter types

In addition to the method parameters that can be annotated with the appropriate Spring Web annotations from the previous table,
`javax.servlet.http.HttpServletRequest` and `javax.servlet.http.HttpServletResponse` are also supported.
For this to function however, users need to add the `quarkus-undertow` dependency.

=== Exception handler method return types

The following method return types are supported:

* `org.springframework.http.ResponseEntity`
* `java.util.Map`

Other return types mentioned in the Spring `https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/ExceptionHandler.html[ExceptionHandler javadoc]` are not supported.

=== Exception handler method parameter types

The following parameter types are supported, in arbitrary order:

* An exception argument: declared as a general `Exception` or as a more specific exception. This also serves as a mapping hint if the annotation itself does not narrow the exception types through its `value()`.
* Request and/or response objects (typically from the Servlet API). You may choose any specific request/response type, e.g. `ServletRequest` / `HttpServletRequest`. To use Servlet API, the `quarkus-undertow` dependency needs to be added.

Other parameter types mentioned in the Spring `https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/ExceptionHandler.html[ExceptionHandler javadoc]` are not supported.

== Important Technical Note

Expand Down

0 comments on commit 3b09f7d

Please sign in to comment.