Package com.opensymphony.xwork2.util

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


        proxy.execute();
        proxy.getAction();

        //then
        assertEquals("This is blah", ((SimpleAction) proxy.getAction()).getBlah());
        Object allowMethodAccess = stack.findValue("\u0023_memberAccess['allowStaticMethodAccess']");
        assertNotNull(allowMethodAccess);
        assertEquals(Boolean.FALSE, allowMethodAccess);
    }

    public void testParameters() throws Exception {
View Full Code Here


        if (expr == null) {
            return null;
        }

        ValueStack stack = context.getStack();
        return stack.findValue(ComponentUtils.stripExpressionIfAltSyntax(stack, expr));
    }

    private Object findValue(String expr, Class toType) {
        ValueStack stack = context.getStack();
View Full Code Here

        ValueStack stack = context.getStack();

        if (altSyntax && toType == String.class) {
            return TextParseUtil.translateVariables('%', expr, stack);
        } else {
            return stack.findValue(ComponentUtils.stripExpressionIfAltSyntax(stack, expr), toType);
        }
    }
}
View Full Code Here

        final ValueStack stack = ActionContext.getContext().getValueStack();

        if (application != null)
            for (int i = 0; i < application.length; i++) {
                String string = application[i];
                Object value = stack.findValue(string);
                if (LOG.isDebugEnabled()) {
                    LOG.debug("application scoped variable saved " + string + " = " + String.valueOf(value));
                }

                //if( value != null)
View Full Code Here

                for (int i = 0; i < session.length; i++) {
                    String string = session[i];
                    if (ends) {
                        ses.remove(key + string);
                    } else {
                        Object value = stack.findValue(string);

                        if (LOG.isDebugEnabled()) {
                            LOG.debug("session scoped variable saved " + string + " = " + String.valueOf(value));
                        }
View Full Code Here

    }

    public void testValueStackWithTypeParameter() {
        ValueStack stack = ActionContext.getContext().getValueStack();
        stack.push(new Foo1());
        Bar1 bar = (Bar1) stack.findValue("bar", Bar1.class);
        assertNotNull(bar);
    }

    public void testGenericProperties() {
        GenericsBean gb = new GenericsBean();
View Full Code Here

        stack.setValue("genericMap[123.12]", "66");
        stack.setValue("genericMap[456.12]", "42");

        assertEquals(2, gb.getGenericMap().size());
        assertEquals(Integer.class, stack.findValue("genericMap.get(123.12).class"));
        assertEquals(Integer.class, stack.findValue("genericMap.get(456.12).class"));
        assertEquals(66, stack.findValue("genericMap.get(123.12)"));
        assertEquals(42, stack.findValue("genericMap.get(456.12)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(66)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(42)"));
View Full Code Here

        stack.setValue("genericMap[123.12]", "66");
        stack.setValue("genericMap[456.12]", "42");

        assertEquals(2, gb.getGenericMap().size());
        assertEquals(Integer.class, stack.findValue("genericMap.get(123.12).class"));
        assertEquals(Integer.class, stack.findValue("genericMap.get(456.12).class"));
        assertEquals(66, stack.findValue("genericMap.get(123.12)"));
        assertEquals(42, stack.findValue("genericMap.get(456.12)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(66)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(42)"));
        assertEquals(true, stack.findValue("genericMap.containsKey(123.12)"));
View Full Code Here

        stack.setValue("genericMap[456.12]", "42");

        assertEquals(2, gb.getGenericMap().size());
        assertEquals(Integer.class, stack.findValue("genericMap.get(123.12).class"));
        assertEquals(Integer.class, stack.findValue("genericMap.get(456.12).class"));
        assertEquals(66, stack.findValue("genericMap.get(123.12)"));
        assertEquals(42, stack.findValue("genericMap.get(456.12)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(66)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(42)"));
        assertEquals(true, stack.findValue("genericMap.containsKey(123.12)"));
        assertEquals(true, stack.findValue("genericMap.containsKey(456.12)"));
View Full Code Here

        assertEquals(2, gb.getGenericMap().size());
        assertEquals(Integer.class, stack.findValue("genericMap.get(123.12).class"));
        assertEquals(Integer.class, stack.findValue("genericMap.get(456.12).class"));
        assertEquals(66, stack.findValue("genericMap.get(123.12)"));
        assertEquals(42, stack.findValue("genericMap.get(456.12)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(66)"));
        assertEquals(true, stack.findValue("genericMap.containsValue(42)"));
        assertEquals(true, stack.findValue("genericMap.containsKey(123.12)"));
        assertEquals(true, stack.findValue("genericMap.containsKey(456.12)"));
    }
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.