g*****g 发帖数: 34805 | 1 Is it possible in a controller, when you redirect to another controller,
put some data in request scope so the controller you redirect to can
get it? I guess this is a common problem in Spring. |
m******t 发帖数: 2416 | 2 Put the data in the model. It'll go into the redirection url as a parameter/
value pair.
The common problem in Spring is actually the opposite of yours - a lot of
people don't want the model to carry over when they redirect. 8-) |
g*****g 发帖数: 34805 | 3 I never thought that would be a problem, just clean it in your controller
before redirect.
parameter/
【在 m******t 的大作中提到】 : Put the data in the model. It'll go into the redirection url as a parameter/ : value pair. : The common problem in Spring is actually the opposite of yours - a lot of : people don't want the model to carry over when they redirect. 8-)
|
m******t 发帖数: 2416 | 4
The problem is somewhat more subtle than the ability to do it - which by
itself like you said is fairly straightforward. The problem is by actively
cleaning the model, the controller explicitly acknowledges that it _knows_
the view is a redirect view, which kind of undermines the separation of
controller and view.
【在 g*****g 的大作中提到】 : I never thought that would be a problem, just clean it in your controller : before redirect. : : parameter/
|