@Override public PageAction getParent() { return pageInstance.getParent().getActionBean(); }
@Override public PageAction getParent() { return pageInstance.getParent().getActionBean(); }
@Deprecated public static PageAction ensureActionBean(PageInstance page) throws IllegalAccessException, InstantiationException { PageAction action = page.getActionBean(); assert action != null; if(action == null) { action = page.getActionClass().newInstance(); page.setActionBean(action); } return action; }
currentElement = dispatch.getLastPageInstance().getActionBean();
@Override protected ActionBean makeNewActionBean( Class<? extends ActionBean> type, ActionBeanContext context) throws Exception { Dispatch dispatch = DispatcherUtil.getDispatch(context.getRequest()); if(dispatch != null) { PageInstance pageInstance = dispatch.getLastPageInstance(); if(type.equals(pageInstance.getActionClass())) { if(pageInstance.getActionBean() != null) { return pageInstance.getActionBean(); } else { assert false; if(DispatcherLogic.isValidActionClass(type)) { ActionBean actionBean = super.makeNewActionBean(type, context); pageInstance.setActionBean((PageAction) actionBean); return actionBean; } else { throw new Exception("Invalid action bean type for dispatch: " + type); //TODO } } } } return super.makeNewActionBean(type, context); }
public static boolean isEmbedded(PageAction pageAction) { PageInstance parent = pageAction.getPageInstance().getParent(); if(parent == null) { return false; //Root page } PageAction parentActionBean = parent.getActionBean(); if(parentActionBean == null) { return false; } String parentPath = parentActionBean.getContext().getActionPath(); String myPath = pageAction.getContext().getActionPath(); return !StringUtils.equals(parentPath, myPath); } }
PageAction actionBean = page.getActionBean(); try { actionBean.setContext(actionContext);