Package com.opensymphony.xwork2

Examples of com.opensymphony.xwork2.ActionInvocation


     *
     * @param clazz the action.
     * @return a validator key which is the class name plus context.
     */
    protected static String buildValidatorKey(Class clazz, String context) {
        ActionInvocation invocation = ActionContext.getContext().getActionInvocation();
        ActionProxy proxy = invocation.getProxy();
        ActionConfig config = proxy.getConfig();

        StringBuilder sb = new StringBuilder(clazz.getName());
        sb.append("/");
        if (StringUtils.isNotBlank(config.getPackageName())) {
View Full Code Here


            }
            HttpServletRequest request = (HttpServletRequest) getRequest();
            HttpServletResponse response = (HttpServletResponse) getResponse();

            ActionContext ctx = ServletActionContext.getActionContext(request);
            ActionInvocation invocation = ctx.getActionInvocation();

            try {
                FreemarkerResult result = new FreemarkerResult();
                result.setWriter(response.getWriter());
View Full Code Here

        ActionContext actionContext = ActionContext.getContext();
        HttpServletRequest request = (HttpServletRequest) actionContext
                .get(StrutsStatics.HTTP_REQUEST);
        ConversationContextManager contextManager = conversationContextManagerFactory
                .getManager(request);
        ActionInvocation invocation = actionContext.getActionInvocation();
        return new StrutsConversationAdapter(invocation, contextManager);
    }
View Full Code Here

    }

    @Override
    public String execute() throws Exception {
        String result = this.parentProxy.execute();
        ActionInvocation invocation = this.parentProxy.getInvocation();
        for (ProxyExecutionListener listener : listeners) {
            listener.afterProxyExecution(invocation, result);
        }
        return result;
    }
View Full Code Here

    }

    @Override
    public String execute() throws Exception {
        String result = this.parentProxy.execute();
        ActionInvocation invocation = this.parentProxy.getInvocation();
        for (ProxyExecutionListener listener : listeners) {
            listener.afterProxyExecution(invocation, result);
        }
        return result;
    }
View Full Code Here

        ActionContext actionContext = ActionContext.getContext();
        HttpServletRequest request = (HttpServletRequest) actionContext
                .get(StrutsStatics.HTTP_REQUEST);
        ConversationContextManager contextManager = this.conversationContextManagerFactory
                .getManager(request);
        ActionInvocation invocation = actionContext.getActionInvocation();
        return new StrutsConversationAdapter(invocation, contextManager);
    }
View Full Code Here

        ActionContext actionContext = ActionContext.getContext();
        HttpServletRequest request = (HttpServletRequest) actionContext
                .get(StrutsStatics.HTTP_REQUEST);
        ConversationContextManager contextManager = this.conversationContextManagerFactory
                .getManager(request);
        ActionInvocation invocation = actionContext.getActionInvocation();
        return new StrutsConversationAdapter(invocation, contextManager);
    }
View Full Code Here

    }

    @Override
    public String execute() throws Exception {
        String result = this.parentProxy.execute();
        ActionInvocation invocation = this.parentProxy.getInvocation();
        for (ProxyExecutionListener listener : listeners) {
            listener.afterProxyExecution(invocation, result);
        }
        return result;
    }
View Full Code Here

        ActionContext actionContext = new ActionContext(new HashMap());
        actionContext.put(ActionContext.PARAMETERS, paramMap);
        actionContext.put(ActionContext.SESSION, sessionMap);

        // Mock (ActionInvocation)
        ActionInvocation mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class);
        mockActionInvocation.getInvocationContext();
        EasyMock.expectLastCall().andReturn(actionContext);
        EasyMock.expectLastCall().anyTimes();

        mockActionInvocation.invoke();
        EasyMock.expectLastCall().andReturn(Action.SUCCESS);

        mockActionInvocation.getAction();
        EasyMock.expectLastCall().andReturn(action);


        EasyMock.replay(mockActionInvocation);
View Full Code Here

        interceptor.setAllowRequestParameterSwitch(true);


        ActionSupport action = new ActionSupport();

        ActionInvocation mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class);
        mockActionInvocation.invoke();
        EasyMock.expectLastCall().andReturn(Action.SUCCESS);

        Map paramsMap = new LinkedHashMap();
        Map sessionMap = new LinkedHashMap();

        List actionErrors = new ArrayList();
        List actionMessages = new ArrayList();
        Map fieldErrors = new LinkedHashMap();

        actionErrors.add("some action error 1");
        actionErrors.add("some action error 2");
        actionMessages.add("some action messages 1");
        actionMessages.add("some action messages 2");
        List field1Errors = new ArrayList();
        field1Errors.add("some field error 1");
        List field2Errors = new ArrayList();
        field2Errors.add("some field error 2");
        fieldErrors.put("field1", field1Errors);
        fieldErrors.put("field2", field2Errors);

        sessionMap.put(MessageStoreInterceptor.actionErrorsSessionKey, actionErrors);
        sessionMap.put(MessageStoreInterceptor.actionMessagesSessionKey, actionMessages);
        sessionMap.put(MessageStoreInterceptor.fieldErrorsSessionKey, fieldErrors);


        ActionContext actionContext = new ActionContext(new HashMap());
        actionContext.put(ActionContext.PARAMETERS, paramsMap);
        actionContext.put(ActionContext.SESSION, sessionMap);

        mockActionInvocation.getInvocationContext();
        EasyMock.expectLastCall().andReturn(actionContext);
        EasyMock.expectLastCall().anyTimes();

        mockActionInvocation.getAction();
        EasyMock.expectLastCall().andReturn(action);

        EasyMock.replay(mockActionInvocation);

        interceptor.init();
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.ActionInvocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.