// to pass a parameter along the chain, thus this somewhat ugly hack
if (invocation.getStack().getRoot().size() > 1) {
Object action0= invocation.getStack().getRoot().get(0);
Object action1 = invocation.getStack().getRoot().get(1);
if (action0 instanceof EntryEdit && action1 instanceof EntryAdd) {
EntryEdit editAction = (EntryEdit)action0;
EntryAdd addAction = (EntryAdd)action1;
editAction.getBean().setId(addAction.getBean().getId());
} else if (action0 instanceof EntryAdd && action1 instanceof EntryAddWithMediaFile) {
EntryAdd addAction = (EntryAdd)action0;
EntryAddWithMediaFile mediaAction = (EntryAddWithMediaFile)action1;
addAction.setBean(mediaAction.getBean());
}