PDA

View Full Version : How do I get to my values?



ruipacheco
Aug 2nd, 2005, 05:19 AM
Lets suppose I have a flow with several JSP's and several Actions. What is the correct way to get to values inserted in the first jsp's?
I am using getSourceEvent().getParameter("myParameter"), but I can only get to the values inserted previously, not the values inserted two views back.
What do I have to do to reach those values?

Colin Yates
Aug 2nd, 2005, 05:27 AM
How are you returning events? By default success() doesn't copy the values through.

I created this action for this purpose:



public abstract class AbstractChainedAction extends AbstractAction implements ApplicationContextAware {
private ApplicationContext applicationContext;

public final Event success(final RequestContext context) {
return result(SUCCESS_RESULT_EVENT_ID, context.getSourceEvent().getParameters());
}

public final Event error(final RequestContext context) {
return result(ERROR_RESULT_EVENT_ID, context.getSourceEvent().getParameters());
}

public final void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}

protected final ApplicationContext getApplicationContext() {
return applicationContext;
}
}