Package com.opensymphony.xwork2.util

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


                }
            };
        }

        try {
            stack.push(templateContext.getTag());
            template.process(model, writer);
        } finally {
            stack.pop();
        }
    }
View Full Code Here


        if (LOG.isDebugEnabled()) {
            LOG.debug("Trying to render template " + template + ", repeating through parents until we succeed");
        }
        UIBean tag = templateContext.getTag();
        ValueStack stack = templateContext.getStack();
        stack.push(tag);
        PageContext pageContext = (PageContext) stack.getContext().get(ServletActionContext.PAGE_CONTEXT);
        List templates = template.getPossibleTemplates(this);
        Exception exception = null;
        boolean success = false;
        for (Iterator iterator = templates.iterator(); iterator.hasNext();) {
View Full Code Here

        boolean result = super.start(writer);

        ValueStack stack = getStack();

        if (stack != null) {
            stack.push(findValue(value, "value", "You must specify a value to push on the stack. Example: person"));
            pushed = true;
        } else {
            pushed = false; // need to ensure push is assigned, otherwise we may have a leftover value
        }
View Full Code Here

        iterator = MakeIterator.convert(findValue(value));
       
        // get the first
        if ((iterator != null) && iterator.hasNext()) {
            Object currentValue = iterator.next();
            stack.push(currentValue);

            String id = getId();
           
            if ((id != null) && (currentValue != null)) {
                //pageContext.setAttribute(id, currentValue);
View Full Code Here

                ActionProxy action = (ActionProxy) request.getPortletSession()
                        .getAttribute(EVENT_ACTION);
                if (action != null) {
                    ValueStack stack = proxy.getInvocation().getStack();
                    Object top = stack.pop();
                    stack.push(action.getInvocation().getAction());
                    stack.push(top);
                }
            }
            proxy.execute();
            if (PortletActionConstants.EVENT_PHASE.equals(phase)) {
View Full Code Here

                        .getAttribute(EVENT_ACTION);
                if (action != null) {
                    ValueStack stack = proxy.getInvocation().getStack();
                    Object top = stack.pop();
                    stack.push(action.getInvocation().getAction());
                    stack.push(top);
                }
            }
            proxy.execute();
            if (PortletActionConstants.EVENT_PHASE.equals(phase)) {
                // Store the executed action in the session for retrieval in the
View Full Code Here

*
*/
public class PropertyTest extends TestCase {
    public void testNormalBehaviour() {
        final ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.push(new FooBar("foo-value", "bar-value"));
        final Property property = new Property(stack);
        property.setDefault("default");
        property.setValue("foo");
        assertPropertyOutput("foo-value", property);
    }
View Full Code Here

        assertPropertyOutput("default", property);
    }
    public void testDefaultShouldBeOutputIfPropertyIsNull() {
        final ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.push(new FooBar(null, "bar-value"));
        final Property property = new Property(stack);
        property.setDefault("default");
        property.setValue("foo");
        assertPropertyOutput("default", property);
    }
View Full Code Here

        assertPropertyOutput("default", property);
    }
    public void testTopValueShouldReturnTopOfValueStack() {
        final ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        stack.push(new FooBar("foo-value", "bar-value"));
        final Property property = new Property(stack);
        property.setDefault("default");
        property.setValue("top");
        assertPropertyOutput("foo-value/bar-value", property);
    }
View Full Code Here

        String location = "/myaction.action";
        Bean bean = new Bean();
        bean.setLocation(location);

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

        assertEquals(location, stack.findValue("location"));

        result.setLocation("${location}");
        result.execute(actionInvocation);
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.