Skip to content

Commit 4391b29

Browse files
committed
Annotation-level javadoc for Model parameter on exception handler methods
Issue: SPR-13546
1 parent 6210ab9 commit 4391b29

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

spring-web/src/main/java/org/springframework/web/bind/annotation/ExceptionHandler.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,8 +27,8 @@
2727
* handler methods. Provides consistent style between Servlet and Portlet
2828
* environments, with the semantics adapting to the concrete environment.
2929
*
30-
* <p>Handler methods which are annotated with this annotation are allowed
31-
* to have very flexible signatures. They may have arguments of the following
30+
* <p>Handler methods which are annotated with this annotation are allowed to
31+
* have very flexible signatures. They may have parameters of the following
3232
* types, in arbitrary order:
3333
* <ul>
3434
* <li>An exception argument: declared as a general Exception or as a more
@@ -48,8 +48,9 @@
4848
* As a consequence, such an argument will never be {@code null}.
4949
* <i>Note that session access may not be thread-safe, in particular in a
5050
* Servlet environment: Consider switching the
51-
* {@link org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#setSynchronizeOnSession "synchronizeOnSession"}
52-
* flag to "true" if multiple requests are allowed to access a session concurrently.</i>
51+
* {@link org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#setSynchronizeOnSession
52+
* "synchronizeOnSession"} flag to "true" if multiple requests are allowed to
53+
* access a session concurrently.</i>
5354
* <li>{@link org.springframework.web.context.request.WebRequest} or
5455
* {@link org.springframework.web.context.request.NativeWebRequest}.
5556
* Allows for generic request parameter access as well as request/session
@@ -64,13 +65,17 @@
6465
* <li>{@link java.io.OutputStream} / {@link java.io.Writer} for generating
6566
* the response's content. This will be the raw OutputStream/Writer as
6667
* exposed by the Servlet/Portlet API.
68+
* <li>{@link org.springframework.ui.Model} as an alternative to returning
69+
* a model map from the handler method. Note that the provided model is not
70+
* pre-populated with regular model attributes and therefore always empty,
71+
* as a convenience for preparing the model for an exception-specific view.
6772
* </ul>
6873
*
6974
* <p>The following return types are supported for handler methods:
7075
* <ul>
7176
* <li>A {@code ModelAndView} object (Servlet MVC or Portlet MVC).
72-
* <li>A {@link org.springframework.ui.Model Model} object, with the view name
73-
* implicitly determined through a {@link org.springframework.web.servlet.RequestToViewNameTranslator}.
77+
* <li>A {@link org.springframework.ui.Model} object, with the view name implicitly
78+
* determined through a {@link org.springframework.web.servlet.RequestToViewNameTranslator}.
7479
* <li>A {@link java.util.Map} object for exposing a model,
7580
* with the view name implicitly determined through a
7681
* {@link org.springframework.web.servlet.RequestToViewNameTranslator}.

0 commit comments

Comments
 (0)