/** * A flash result, that save the current action into the http session before * invoking <code>super.doExecute(...)</code>. * * @see com.opensymphony.webwork.dispatcher.ServletRedirectResult#doExecute(java.lang.String, com.opensymphony.xwork.ActionInvocation) */ protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception { // before we redirect, let's save the state in to the session Object action = invocation.getAction(); Map session = invocation.getInvocationContext().getSession(); session.put(FlashInterceptor.DEFAULT_KEY, action); super.doExecute(finalLocation, invocation); }
public String intercept( ActionInvocation invocation ) throws Exception { // A no-op here. Work for this intereceptor is done in init(). return invocation.invoke(); } }
public SavedActionInvocation( ActionInvocation invocation ) { namespace = invocation.getProxy().getNamespace(); actionName = invocation.getProxy().getActionName(); methodName = invocation.getProxy().getMethod(); parameterMap = new HashMap(); parameterMap.putAll( invocation.getInvocationContext().getParameters() ); }
public Action extractAction(ActionInvocation invocation) { return invocation.getAction(); }
public String intercept( ActionInvocation actionInvocation ) throws Exception { ActionContext actionContext = actionInvocation.getInvocationContext(); ActionConfig actionConfig = actionInvocation.getProxy().getConfig(); String methodName = actionConfig != null ? actionConfig.getMethodName() : null; String actionName = actionContext != null ? actionContext.getName() : null; Action action = actionInvocation.getAction(); if ( action instanceof OverriddenAction ) { OverriddenAction overriddenAction = (OverriddenAction) action; return actionInvocation.invoke(); } finally { if ( actionConfig != null ) {
protected String handleInvalidToken(ActionInvocation invocation) throws Exception { ActionContext ac = invocation.getInvocationContext(); OgnlValueStack stack = savedInvocation.getStack(); Map context = stack.getContext(); request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY, stack); ActionContext savedContext = savedInvocation.getInvocationContext(); savedContext.getContextMap().put(ServletActionContext.HTTP_REQUEST, request); savedContext.getContextMap().put(ServletActionContext.HTTP_RESPONSE, response); Result result = savedInvocation.getResult(); if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) { synchronized (context) { result.execute(savedInvocation); invocation.getProxy().setExecuteResult(false); return savedInvocation.getResultCode();
oInput = (InputStream) invocation.getStack().findValue(conditionalParse(inputName, invocation)); HttpServletResponse oResponse = (HttpServletResponse) invocation.getInvocationContext().get(HTTP_RESPONSE);
/** * Get the operationMode through request paramter, if <code>allowRequestParameterSwitch</code> * is 'true', else it simply returns 'NONE', meaning its neither in the 'STORE_MODE' nor * 'RETRIEVE_MODE'. * * @return String */ protected String getRequestOperationMode(ActionInvocation invocation) { String reqOperationMode = NONE; if (allowRequestParameterSwitch) { Map reqParams = (Map) invocation.getInvocationContext().get(ActionContext.PARAMETERS); boolean containsParameter = reqParams.containsKey(requestParameterSwitch); if (containsParameter) { String[] reqParamsArr = (String[]) reqParams.get(requestParameterSwitch); if (reqParamsArr != null && reqParamsArr.length > 0) { reqOperationMode = reqParamsArr[0]; } } } return reqOperationMode; }
public String intercept(ActionInvocation actionInvocation) throws Exception { ActionProxy proxy = actionInvocation.getProxy(); String name = proxy.getActionName(); ActionContext context = actionInvocation.getInvocationContext(); Map session = context.getSession(); actionInvocation.getStack().push(bp.getAction()); Map results = proxy.getConfig().getResults(); if (!results.containsKey(WAIT)) { } else { session.remove(KEY + name); actionInvocation.getStack().push(bp.getAction());
/** * Get the <code>FoldersAndFiles</code> computed from AbstractRichtexteditorConnector or its * decendant through AbstractRichtexteditorConnector#getFoldersAndFiles(String, String). Only * valid if it is a 'GetFoldersAndFiles' command. * * @param invocation * @return The <code>FoldersAndFiles</code> computed from AbstractRichtexteditorConnector * @see com.opensymphony.webwork.components.AbstractRichtexteditorConnector#getFoldersAndFiles(String, String) */ protected FoldersAndFiles richtexteditorFoldersAndFiles(ActionInvocation invocation) { return (FoldersAndFiles) invocation.getStack().getContext().get("__richtexteditorGetFoldersAndFiles"); }
Action action = (Action) context.getActionInvocation().getAction(); return invocation.invoke(); return invocation.invoke(); return invocation.invoke(); String result = invocation.invoke(); getLogger().debug( "Passing invocation up, result is [" + result + "] on call " + invocation.getAction().getClass().getName() ); return result;
actionName, extraContext); request.setAttribute("webwork.valueStack", proxy.getInvocation() .getStack()); if (PortletActionConstants.RENDER_PHASE.equals(phase) && StringUtils.isNotEmpty(request .getAttribute(EVENT_ACTION); if (action != null) { OgnlValueStack stack = proxy.getInvocation().getStack(); Object top = stack.pop(); stack.push(action.getInvocation().getAction()); stack.push(top);
public String intercept( ActionInvocation invocation ) throws Exception { String result; try { result = invocation.invoke(); } catch ( Exception e ) { List exceptionMappings = invocation.getProxy().getConfig().getExceptionMappings(); String mappedResult = this.findResultFromExceptionMappings( exceptionMappings, e ); if ( mappedResult != null ) { result = mappedResult; if ( result.equals( IGNORE ) ) { throw e; } publishException( invocation, new ExceptionHolder( e ) ); } else { throw e; } } return result; }
/** * Given a value stack, a Velocity engine, and an action invocation, this method returns the appropriate * Velocity template to render. * * @param stack the value stack to resolve the location again (when parse equals true) * @param velocity the velocity engine to process the request against * @param invocation an encapsulation of the action execution state. * @param location the location of the template * @param encoding the charset encoding of the template * @return the template to render * @throws Exception when the requested template could not be found */ protected Template getTemplate(OgnlValueStack stack, VelocityEngine velocity, ActionInvocation invocation, String location, String encoding) throws Exception { if (!location.startsWith("/")) { location = invocation.getProxy().getNamespace() + "/" + location; } Template template = velocity.getTemplate(location, encoding); return template; }
ctx.getParameters().remove(DEBUG_PARAM); if (XML_MODE.equals(type)) { inv.addPreResultListener( new PreResultListener() { public void beforeResult(ActionInvocation inv, String result) { inv.addPreResultListener( new PreResultListener() { public void beforeResult(ActionInvocation inv, String actionResult) { return inv.invoke(); } finally { if (devMode) {
public void execute(ActionInvocation invocation) throws Exception { actionName = conditionalParse(actionName, invocation); if (namespace == null) { namespace = invocation.getProxy().getNamespace(); } else { namespace = conditionalParse(namespace, invocation); ResultConfig resultConfig = (ResultConfig) invocation.getProxy().getConfig().getResults().get( invocation.getResultCode()); Map resultConfigParams = resultConfig.getParams(); for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext(); ) {
public String intercept(ActionInvocation invocation) throws Exception { ActionContext ac = invocation.getInvocationContext(); HttpServletRequest request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST); ActionProxy proxy = invocation.getProxy(); log.debug(getTextMessage("webwork.messages.bypass.request", new Object[]{proxy.getNamespace(), proxy.getActionName()}, ActionContext.getContext().getLocale())); return invocation.invoke(); final Object action = invocation.getAction(); ValidationAware validation = null; String result = invocation.invoke();
HttpServletRequest request = (HttpServletRequest) invocation.getInvocationContext().get(ServletActionContext.HTTP_REQUEST); HttpServletResponse response = (HttpServletResponse) invocation.getInvocationContext().get(ServletActionContext.HTTP_RESPONSE); OgnlValueStack stack = invocation.getStack(); OgnlValueStackDataSource stackDataSource = new OgnlValueStackDataSource(stack, dataSource); ServletContext servletContext = (ServletContext) invocation.getInvocationContext().get(ServletActionContext.SERVLET_CONTEXT); String systemId = servletContext.getRealPath(finalLocation); Map parameters = new OgnlValueStackShadowMap(stack); File directory = new File(systemId.substring(0, systemId.lastIndexOf(File.separator))); parameters.put("reportDirectory", directory); parameters.put(JRParameter.REPORT_LOCALE, invocation.getInvocationContext().getLocale());
protected synchronized ActionInvocationTracker addActionInvocation( ActionInvocation invocation ) throws ComponentLookupException { Map sessionMap = invocation.getInvocationContext().getSession(); ActionInvocationTracker tracker = (ActionInvocationTracker) sessionMap.get( ActionInvocationTracker.ROLE ); if ( tracker == null ) { ActionContext actionContext = invocation.getInvocationContext(); PlexusContainer container = (PlexusContainer) actionContext.getApplication().get( PlexusLifecycleListener.KEY ); //noinspection deprecation tracker = (ActionInvocationTracker) container.lookup( ActionInvocationTracker.ROLE, getTrackerName() ); sessionMap.put( ActionInvocationTracker.ROLE, tracker ); } tracker.addActionInvocation( invocation ); return tracker; } }