public static Dispatch getDispatch(HttpServletRequest request) { Dispatcher dispatcher = get(request); return getDispatch(dispatcher, request); }
public Resolution intercept(ExecutionContext context) throws Exception { logger.debug("Retrieving Stripes objects"); ActionBeanContext actionContext = context.getActionBeanContext(); ActionBean actionBean = context.getActionBean(); Method handler = context.getHandler(); logger.debug("Retrieving Servlet API objects"); HttpServletRequest request = actionContext.getRequest(); Dispatch dispatch = DispatcherUtil.getDispatch(request); if(SecurityLogic.isAllowed(request, dispatch, actionBean, handler)) { logger.debug("Security check passed."); return context.proceed(); } else { return new ForbiddenAccessResolution(); } }
public static Dispatch getDispatch(ActionBeanContext context) { HttpServletRequest request = context.getRequest(); Dispatcher dispatcher = get(request); if(context instanceof ElementsActionBeanContext) { String actionPath = ((ElementsActionBeanContext) context).getActionPath(); return dispatcher.getDispatch(actionPath); } else { return getDispatch(request); } }
public static Dispatch getDispatch(HttpServletRequest request, Object actionBean) { Dispatcher dispatcher = get(request); if(actionBean instanceof AbstractActionBean) { String actionPath = ((AbstractActionBean) actionBean).getContext().getActionPath(); return dispatcher.getDispatch(actionPath); } else { return getDispatch(request); } }
@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); }
ognlContext.put("textProvider", new TextProviderBean(ElementsThreadLocals.getTextProvider())); Dispatch dispatch = DispatcherUtil.getDispatch(actionContext); if (dispatch != null) { HttpServletRequest request = actionContext.getRequest();