Package com.opensymphony.xwork2.util

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


        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


    public void testTypeConverterShouldBeUsed() {
        final ValueStack stack = ValueStackFactory.getFactory().createValueStack();
        Ognl.setTypeConverter(stack.getContext(), new TestDefaultConverter());
        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

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

        assertEquals(value1, writer.toString());
        final StringBuffer buffer = writer.getBuffer();
        buffer.delete(0, buffer.length());
        ValueStack newStack = ValueStackFactory.getFactory().createValueStack();
        newStack.getContext().put(ActionContext.LOCALE, foreignLocale);
        newStack.push(new TestAction1());
        request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, newStack);
        assertNotSame(ActionContext.getContext().getValueStack().peek(), newStack.peek());

        tag.doStartTag();
        tag.doEndTag();
View Full Code Here

public class StrutsResultSupportTest extends StrutsTestCase {

 
  public void testParse() throws Exception {
    ValueStack stack = ValueStackFactory.getFactory().createValueStack();
    stack.push(new ActionSupport() {
      public String getMyLocation() {
        return "ThisIsMyLocation";
      }
    });
   
View Full Code Here

    EasyMock.verify(mockActionInvocation);
  }
 
  public void testParseAndEncode() throws Exception {
    ValueStack stack = ValueStackFactory.getFactory().createValueStack();
    stack.push(new ActionSupport() {
      public String getMyLocation() {
        return "/myPage?param=value&param1=value1";
      }
    });
   
View Full Code Here

  }
 
 
  public void testNoParseAndEncode() throws Exception {
    ValueStack stack = ValueStackFactory.getFactory().createValueStack();
    stack.push(new ActionSupport() {
      public String getMyLocation() {
        return "myLocation.jsp";
      }
    });
   
View Full Code Here

  protected Object getOverrideExpr(ActionInvocation invocation, Object value) {
        ValueStack stack = invocation.getStack();

        try {
            stack.push(value);

            return "'" + stack.findValue("top", String.class) + "'";
        } finally {
            stack.pop();
        }
View Full Code Here

            return false;
        }

        // push bean on stack
        stack.push(bean);

        // store for reference later
        if (getId() != null) {
            getStack().getContext().put(getId(), bean);
        }
View Full Code Here

        iterator = MakeIterator.convert( valObject );
        if( iterator == null || !iterator.hasNext())
          return false;

        Object currentValue = iterator.next();
        stack.push(currentValue);

        String id = getId();
        if((id != null) && (currentValue != null)) {
            stack.getContext().put(id, currentValue);
        }
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.