Examples of ActionInvocation


Examples of com.opensymphony.xwork2.ActionInvocation

        }

        if (ModelDriven.class.isAssignableFrom(aClass)) {
            ActionContext context = ActionContext.getContext();
            // search up model's class hierarchy
            ActionInvocation actionInvocation = context.getActionInvocation();

            // ActionInvocation may be null if we're being run from a Sitemesh filter, so we won't get model texts if this is null
            if (actionInvocation != null) {
                Object action = actionInvocation.getAction();
                if (action instanceof ModelDriven) {
                    Object model = ((ModelDriven) action).getModel();
                    if (model != null) {
                        msg = findMessage(model.getClass(), aTextName, indexedTextName, locale, args, null, valueStack);
                        if (msg != null) {
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

        map.put(BASE, req.getContextPath());
        map.put(STACK, stack);
        map.put(OGNL, ((Container)stack.getContext().get(ActionContext.CONTAINER)).getInstance(OgnlTool.class));
        map.put(STRUTS, new StrutsUtil(stack, req, res));

        ActionInvocation invocation = (ActionInvocation) stack.getContext().get(ActionContext.ACTION_INVOCATION);
        if (invocation != null) {
            map.put(ACTION, invocation.getAction());
        }
        return map;
    }
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

            }
            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

Examples of com.opensymphony.xwork2.ActionInvocation

        return stack;
    }

    public static String buildNamespace(ActionMapper mapper, ValueStack stack, HttpServletRequest request) {
        ActionContext context = new ActionContext(stack.getContext());
        ActionInvocation invocation = context.getActionInvocation();

        if (invocation == null) {
            ActionMapping mapping = mapper.getMapping(request,
                    Dispatcher.getInstance().getConfigurationManager());

            if (mapping != null) {
                return mapping.getNamespace();
            } else {
                // well, if the ActionMapper can't tell us, and there is no existing action invocation,
                // let's just go with a default guess that the namespace is the last the path minus the
                // last part (/foo/bar/baz.xyz -> /foo/bar)

                String path = RequestUtils.getServletPath(request);
                return path.substring(0, path.lastIndexOf("/"));
            }
        } else {
            return invocation.getProxy().getNamespace();
        }
    }
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

        }

        // get the old value stack from the request
        ValueStack stack = getStack();
        // execute at this point, after params have been set
        ActionInvocation inv = ActionContext.getContext().getActionInvocation();
        try {

            proxy = actionProxyFactory.createActionProxy(namespace, actionName, methodName, createExtraContext(), executeResult, true);
            // set the new stack into the request for the taglib to use
            req.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, proxy.getInvocation().getStack());
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

        if (LOG.isDebugEnabled()) {
            LOG.debug("Rendering template " + templateName);
        }

        ActionInvocation ai = ActionContext.getContext().getActionInvocation();

        Object action = (ai == null) ? null : ai.getAction();
        SimpleHash model = freemarkerManager.buildTemplateModel(stack, action, servletContext, req, res, config.getObjectWrapper());

        model.put("tag", templateContext.getTag());
        model.put("themeProperties", getThemeProps(templateContext.getTemplate()));
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

    controlActionProxy.setReturnValue("save");
   
   
    // ActionInvocation
    MockControl controlActionInvocation = MockControl.createControl(ActionInvocation.class);
    ActionInvocation mockActionInvocation = (ActionInvocation) controlActionInvocation.getMock();
    mockActionInvocation.getAction();
    controlActionInvocation.setReturnValue(action);
    mockActionInvocation.getProxy();
    controlActionInvocation.setReturnValue(mockActionProxy);
   
    controlActionProxy.replay();
    controlActionInvocation.replay();
   
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

    controlActionProxy.setReturnValue("submit");
   
   
    // ActionInvocation
    MockControl controlActionInvocation = MockControl.createControl(ActionInvocation.class);
    ActionInvocation mockActionInvocation = (ActionInvocation) controlActionInvocation.getMock();
    mockActionInvocation.getAction();
    controlActionInvocation.setReturnValue(action);
    mockActionInvocation.getProxy();
    controlActionInvocation.setReturnValue(mockActionProxy);
   
    controlActionProxy.replay();
    controlActionInvocation.replay();
   
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

    controlActionProxy.setReturnValue("cancel");
   
   
    // ActionInvocation
    MockControl controlActionInvocation = MockControl.createControl(ActionInvocation.class);
    ActionInvocation mockActionInvocation = (ActionInvocation) controlActionInvocation.getMock();
    mockActionInvocation.getAction();
    controlActionInvocation.setReturnValue(action);
    mockActionInvocation.getProxy();
    controlActionInvocation.setReturnValue(mockActionProxy);
   
    controlActionProxy.replay();
    controlActionInvocation.replay();
   
View Full Code Here

Examples of com.opensymphony.xwork2.ActionInvocation

    @Override
    public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext,
                                         boolean executeResult, boolean cleanupContext)
    {
        if (this.namespace == null || namespace.startsWith(this.namespace)) {
            ActionInvocation inv = new RestActionInvocation(extraContext, true);
            container.inject(inv);
            return createActionProxy(inv, namespace, actionName, methodName, executeResult, cleanupContext);
        } else {
            return super.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.