52
52
* "/WEB-INF/jsp/test.jsp"
53
53
*
54
54
* <p>As a special feature, redirect URLs can be specified via the "redirect:"
55
- * prefix. E.g.: "redirect:myAction.do " will trigger a redirect to the given
55
+ * prefix. E.g.: "redirect:myAction" will trigger a redirect to the given
56
56
* URL, rather than resolution as standard view name. This is typically used
57
57
* for redirecting to a controller URL after finishing a form workflow.
58
58
*
59
- * <p>Furthermore, forward URLs can be specified via the "forward:" prefix. E.g.:
60
- * "forward:myAction.do " will trigger a forward to the given URL, rather than
59
+ * <p>Furthermore, forward URLs can be specified via the "forward:" prefix.
60
+ * E.g.: "forward:myAction" will trigger a forward to the given URL, rather than
61
61
* resolution as standard view name. This is typically used for controller URLs;
62
62
* it is not supposed to be used for JSP URLs - use logical view names there.
63
63
*
@@ -224,7 +224,7 @@ protected String getContentType() {
224
224
* interpreted as relative to the web application root, i.e. the context
225
225
* path will be prepended to the URL.
226
226
* <p><b>Redirect URLs can be specified via the "redirect:" prefix.</b>
227
- * E.g.: "redirect:myAction.do "
227
+ * E.g.: "redirect:myAction"
228
228
* @see RedirectView#setContextRelative
229
229
* @see #REDIRECT_URL_PREFIX
230
230
*/
@@ -251,7 +251,7 @@ protected boolean isRedirectContextRelative() {
251
251
* difference. However, some clients depend on 303 when redirecting
252
252
* after a POST request; turn this flag off in such a scenario.
253
253
* <p><b>Redirect URLs can be specified via the "redirect:" prefix.</b>
254
- * E.g.: "redirect:myAction.do "
254
+ * E.g.: "redirect:myAction"
255
255
* @see RedirectView#setHttp10Compatible
256
256
* @see #REDIRECT_URL_PREFIX
257
257
*/
@@ -354,7 +354,7 @@ public Map<String, Object> getAttributesMap() {
354
354
* <li>{@code true} - all Views resolved by this resolver will expose path variables
355
355
* <li>{@code false} - no Views resolved by this resolver will expose path variables
356
356
* <li>{@code null} - individual Views can decide for themselves (this is used by the default)
357
- * <ul>
357
+ * </ ul>
358
358
* @see AbstractView#setExposePathVariables
359
359
*/
360
360
public void setExposePathVariables (@ Nullable Boolean exposePathVariables ) {
@@ -469,21 +469,25 @@ protected View createView(String viewName, Locale locale) throws Exception {
469
469
if (!canHandle (viewName , locale )) {
470
470
return null ;
471
471
}
472
+
472
473
// Check for special "redirect:" prefix.
473
474
if (viewName .startsWith (REDIRECT_URL_PREFIX )) {
474
475
String redirectUrl = viewName .substring (REDIRECT_URL_PREFIX .length ());
475
- RedirectView view = new RedirectView (redirectUrl , isRedirectContextRelative (), isRedirectHttp10Compatible ());
476
+ RedirectView view = new RedirectView (redirectUrl ,
477
+ isRedirectContextRelative (), isRedirectHttp10Compatible ());
476
478
String [] hosts = getRedirectHosts ();
477
479
if (hosts != null ) {
478
480
view .setHosts (hosts );
479
481
}
480
- return applyLifecycleMethods (viewName , view );
482
+ return applyLifecycleMethods (REDIRECT_URL_PREFIX , view );
481
483
}
484
+
482
485
// Check for special "forward:" prefix.
483
486
if (viewName .startsWith (FORWARD_URL_PREFIX )) {
484
487
String forwardUrl = viewName .substring (FORWARD_URL_PREFIX .length ());
485
488
return new InternalResourceView (forwardUrl );
486
489
}
490
+
487
491
// Else fall back to superclass implementation: calling loadView.
488
492
return super .createView (viewName , locale );
489
493
}
@@ -505,7 +509,7 @@ protected boolean canHandle(String viewName, Locale locale) {
505
509
506
510
/**
507
511
* Delegates to {@code buildView} for creating a new instance of the
508
- * specified view class, and applies the following Spring lifecycle methods
512
+ * specified view class. Applies the following Spring lifecycle methods
509
513
* (as supported by the generic Spring bean factory):
510
514
* <ul>
511
515
* <li>ApplicationContextAware's {@code setApplicationContext}
0 commit comments