28
28
import java .util .Map ;
29
29
import java .util .regex .Matcher ;
30
30
import java .util .regex .Pattern ;
31
-
32
31
import javax .servlet .http .HttpServletRequest ;
33
32
import javax .servlet .http .HttpServletResponse ;
34
33
77
76
*
78
77
* <p><b>NOTE when using this redirect view in a Portlet environment:</b> Make sure
79
78
* that your controller respects the Portlet <code>sendRedirect</code> constraints.
80
- * When e.g. using {@link org.springframework.web.portlet.mvc.SimpleFormController},
81
- * make sure to set your controller's
82
- * {@link org.springframework.web.portlet.mvc.AbstractFormController#setRedirectAction "redirectAction"}
83
- * property to "true", in order to make the controller base class behave accordingly.
84
79
*
85
80
* @author Rod Johnson
86
81
* @author Juergen Hoeller
@@ -97,6 +92,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
97
92
98
93
private static final Pattern URI_TEMPLATE_VARIABLE_PATTERN = Pattern .compile ("\\ {([^/]+?)\\ }" );
99
94
95
+
100
96
private boolean contextRelative = false ;
101
97
102
98
private boolean http10Compatible = true ;
@@ -109,6 +105,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
109
105
110
106
private boolean expandUriTemplateVariables = true ;
111
107
108
+
112
109
/**
113
110
* Constructor for use as a bean.
114
111
*/
@@ -233,7 +230,6 @@ public void setStatusCode(HttpStatus statusCode) {
233
230
* and close curly braces "{", "}" and you don't want them interpreted
234
231
* as URI variables.
235
232
* <p>Defaults to <code>true</code>.
236
- * @param expandUriTemplateVariables
237
233
*/
238
234
public void setExpandUriTemplateVariables (boolean expandUriTemplateVariables ) {
239
235
this .expandUriTemplateVariables = expandUriTemplateVariables ;
@@ -265,7 +261,6 @@ protected void renderMergedOutputModel(
265
261
throws IOException {
266
262
267
263
String targetUrl = createTargetUrl (model , request );
268
-
269
264
targetUrl = updateTargetUrl (targetUrl , model , request , response );
270
265
271
266
FlashMap flashMap = RequestContextUtils .getOutputFlashMap (request );
@@ -278,7 +273,7 @@ protected void renderMergedOutputModel(
278
273
FlashMapManager flashMapManager = RequestContextUtils .getFlashMapManager (request );
279
274
flashMapManager .saveOutputFlashMap (flashMap , request , response );
280
275
281
- sendRedirect (request , response , targetUrl . toString () , this .http10Compatible );
276
+ sendRedirect (request , response , targetUrl , this .http10Compatible );
282
277
}
283
278
284
279
/**
@@ -362,6 +357,7 @@ private Map<String, String> getCurrentRequestUriVariables(HttpServletRequest req
362
357
* @throws UnsupportedEncodingException if string encoding failed
363
358
* @see #queryProperties
364
359
*/
360
+ @ SuppressWarnings ("unchecked" )
365
361
protected void appendQueryProperties (StringBuilder targetUrl , Map <String , Object > model , String encodingScheme )
366
362
throws UnsupportedEncodingException {
367
363
0 commit comments