Package com.opensymphony.xwork2.util

Examples of com.opensymphony.xwork2.util.OgnlValueStack.push()


            vs.getContext().putAll(Dispatcher.getInstance().createContextMap(req, res, null, servletContext));
            ctx = new ActionContext(vs.getContext());
            if (ctx.getActionInvocation() == null) {
                // put in a dummy ActionSupport so basic functionality still works
                ActionSupport action = new ActionSupport();
                vs.push(action);
                ctx.setActionInvocation(new DummyActionInvocation(action));
            }
        }

        // delegate to the actual page decorator
View Full Code Here


            if ((iterator != null) && iterator.hasNext())
            {
                Object currentValue = iterator.next();
                if (currentValue!=null)
                {
                    stack.push(currentValue);
            /*
             * UPGRADE-struts 2.1.6
             * CHANGE: changed "getId()" to "getVar()"
             * Reason: The Funktion no longer exists.
             */
 
View Full Code Here

        if (action instanceof ModelDriven) {
            ModelDriven modelDriven = (ModelDriven) action;
            ValueStack stack = invocation.getStack();
            Object model = modelDriven.getModel();
            if (model !=  null) {
              stack.push(model);
            }
            if (refreshModelBeforeResult) {
                invocation.addPreResultListener(new RefreshModelBeforeResult(modelDriven, model));
            }
        }
View Full Code Here

                // Clear off the old model instance
                if (originalModel != null) {
                    root.remove(originalModel);
                }
                if (newModel != null) {
                    stack.push(newModel);
                }
            }
        }
    }
}
View Full Code Here

    public void testFieldErrorMessageAddedForComplexProperty() {
        SimpleAnnotationAction action = new SimpleAnnotationAction();
        action.setBean(new AnnotatedTestBean());

        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(action);

        Map<String, Object> ognlStackContext = stack.getContext();
        ognlStackContext.put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);
        ognlStackContext.put(XWorkConverter.CONVERSION_PROPERTY_FULLNAME, "bean.birth");
View Full Code Here

    public void testFieldErrorMessageAddedWhenConversionFails() {
        SimpleAnnotationAction action = new SimpleAnnotationAction();
        action.setDate(null);

        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(action);

        Map<String, Object> ognlStackContext = stack.getContext();
        ognlStackContext.put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);

        String[] value = new String[]{"invalid date"};
View Full Code Here

    }

    public void testFieldErrorMessageAddedWhenConversionFailsOnModelDriven() {
        ModelDrivenAnnotationAction action = new ModelDrivenAnnotationAction();
        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(action);
        stack.push(action.getModel());

        Map<String, Object> ognlStackContext = stack.getContext();
        ognlStackContext.put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);
View Full Code Here

    public void testFieldErrorMessageAddedWhenConversionFailsOnModelDriven() {
        ModelDrivenAnnotationAction action = new ModelDrivenAnnotationAction();
        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(action);
        stack.push(action.getModel());

        Map<String, Object> ognlStackContext = stack.getContext();
        ognlStackContext.put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);

        String[] value = new String[]{"invalid date"};
View Full Code Here

    }

    public void testFindConversionErrorMessage() {
        ModelDrivenAnnotationAction action = new ModelDrivenAnnotationAction();
        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(action);
        stack.push(action.getModel());

        String message = XWorkConverter.getConversionErrorMessage("birth", stack);
        assertNotNull(message);
        assertEquals("Invalid date for birth.", message);
View Full Code Here

    public void testFindConversionErrorMessage() {
        ModelDrivenAnnotationAction action = new ModelDrivenAnnotationAction();
        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(action);
        stack.push(action.getModel());

        String message = XWorkConverter.getConversionErrorMessage("birth", stack);
        assertNotNull(message);
        assertEquals("Invalid date for birth.", message);
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.