polishing

This commit is contained in:
Juergen Hoeller 2010-09-08 22:53:39 +00:00
parent f848e5081d
commit 7a42ff16ac
1 changed files with 11 additions and 7 deletions

View File

@ -252,7 +252,7 @@ public class RedirectView extends AbstractUrlBasedView {
boolean first = (getUrl().indexOf('?') < 0); boolean first = (getUrl().indexOf('?') < 0);
for (Map.Entry<String, Object> entry : queryProperties(model).entrySet()) { for (Map.Entry<String, Object> entry : queryProperties(model).entrySet()) {
Object rawValue = entry.getValue(); Object rawValue = entry.getValue();
Iterator valueIter = null; Iterator valueIter;
if (rawValue != null && rawValue.getClass().isArray()) { if (rawValue != null && rawValue.getClass().isArray()) {
valueIter = Arrays.asList(ObjectUtils.toObjectArray(rawValue)).iterator(); valueIter = Arrays.asList(ObjectUtils.toObjectArray(rawValue)).iterator();
} }
@ -403,14 +403,18 @@ public class RedirectView extends AbstractUrlBasedView {
/** /**
* Determines the status code to use for HTTP 1.1 compatible requests. * Determines the status code to use for HTTP 1.1 compatible requests.
* <p>The default implemenetation returns the {@link #setStatusCode(HttpStatus) statusCode} * <p>The default implemenetation returns the {@link #setStatusCode(HttpStatus) statusCode}
* property if set, or the value of the {@link #RESPONSE_STATUS_ATTRIBUTE} attribute. If neither are * property if set, or the value of the {@link #RESPONSE_STATUS_ATTRIBUTE} attribute.
* set, it defaults to {@link HttpStatus#SEE_OTHER} (303). * If neither are set, it defaults to {@link HttpStatus#SEE_OTHER} (303).
* @param request the request to inspect * @param request the request to inspect
* @return the response * @param response the servlet response
* @param targetUrl the target URL
* @return the response status
*/ */
protected HttpStatus getHttp11StatusCode(HttpServletRequest request, HttpServletResponse response, String targetUrl) { protected HttpStatus getHttp11StatusCode(
if (statusCode != null) { HttpServletRequest request, HttpServletResponse response, String targetUrl) {
return statusCode;
if (this.statusCode != null) {
return this.statusCode;
} }
HttpStatus attributeStatusCode = (HttpStatus) request.getAttribute(View.RESPONSE_STATUS_ATTRIBUTE); HttpStatus attributeStatusCode = (HttpStatus) request.getAttribute(View.RESPONSE_STATUS_ATTRIBUTE);
if (attributeStatusCode != null) { if (attributeStatusCode != null) {