由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Spring question, redirect and carry data over?
相关主题
Spring MVC question.Starter's problem
Re: 有没有办法在browser第一次访问的时候知道是不是支持cookie?JAMWiki, anyone used it?
问个 spring mvc 的 convention 的问题用js写过file upload的来帮个忙吧
how do I get parameters passed by text area (formHow to redirect standard input in java
A design for parameter passing问一简单的问题 关于import
synchronized method does lock the object that passed into the method as a parameter?Question of POP&SMTP server connection
invoke a function dynamically in Java?help on this scope question
jsf commandlink not working when bean in request scopeBuild web server and dispatcher?
相关话题的讨论汇总
话题: redirect话题: spring话题: controller话题: data话题: problem
进入Java版参与讨论
1 (共1页)
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/

1 (共1页)
进入Java版参与讨论
相关主题
Build web server and dispatcher?A design for parameter passing
Object scope questionsynchronized method does lock the object that passed into the method as a parameter?
SWT programming questionsinvoke a function dynamically in Java?
Questionjsf commandlink not working when bean in request scope
Spring MVC question.Starter's problem
Re: 有没有办法在browser第一次访问的时候知道是不是支持cookie?JAMWiki, anyone used it?
问个 spring mvc 的 convention 的问题用js写过file upload的来帮个忙吧
how do I get parameters passed by text area (formHow to redirect standard input in java
相关话题的讨论汇总
话题: redirect话题: spring话题: controller话题: data话题: problem