Package com.opensymphony.xwork2.util

Examples of com.opensymphony.xwork2.util.CompoundRoot


      if(!isProperPrg(invocation)) {
        if (LOG.isDebugEnabled()) LOG.debug("Restoring value stack from event phase");
        ValueStack oldStack = (ValueStack) invocation.getInvocationContext().getSession().get(
        STACK_FROM_EVENT_PHASE);
        if (oldStack != null) {
          CompoundRoot oldRoot = oldStack.getRoot();
          ValueStack currentStack = invocation.getStack();
          CompoundRoot root = currentStack.getRoot();
          root.addAll(oldRoot);
          if (LOG.isDebugEnabled()) LOG.debug("Restored stack");
        }
      }
      else {
        if (LOG.isDebugEnabled()) LOG.debug("Won't restore stack from event phase since it's a proper PRG request");
View Full Code Here


    private boolean devMode;
    private boolean logMissingProperties;

    protected OgnlValueStack(XWorkConverter xworkConverter, CompoundRootAccessor accessor, TextProvider prov, boolean allowStaticAccess) {
        setRoot(xworkConverter, accessor, new CompoundRoot(), allowStaticAccess);
        push(prov);
    }
View Full Code Here

        setRoot(xworkConverter, accessor, new CompoundRoot(), allowStaticAccess);
        push(prov);
    }

    protected OgnlValueStack(ValueStack vs, XWorkConverter xworkConverter, CompoundRootAccessor accessor, boolean allowStaticAccess) {
        setRoot(xworkConverter, accessor, new CompoundRoot(vs.getRoot()), allowStaticAccess);
    }
View Full Code Here

            return root;
        }

        if (root instanceof CompoundRoot) {
            // find real target
            CompoundRoot cr = (CompoundRoot) root;

            try {
                for (Object target : cr) {
                    if (
                            OgnlRuntime.hasSetProperty((OgnlContext) context, target, property)
View Full Code Here

      if(!isProperPrg(invocation)) {
        LOG.debug("Restoring value stack from event phase");
        ValueStack oldStack = (ValueStack) invocation.getInvocationContext().getSession().get(
        STACK_FROM_EVENT_PHASE);
        if (oldStack != null) {
          CompoundRoot oldRoot = oldStack.getRoot();
          ValueStack currentStack = invocation.getStack();
          CompoundRoot root = currentStack.getRoot();
          root.addAll(0, oldRoot);
          LOG.debug("Restored stack");
        }
      }
      else {
        LOG.debug("Won't restore stack from event phase since it's a proper PRG request");
View Full Code Here

      if(!isProperPrg(invocation)) {
        LOG.debug("Restoring value stack from event phase");
        ValueStack oldStack = (ValueStack) invocation.getInvocationContext().getSession().get(
        STACK_FROM_EVENT_PHASE);
        if (oldStack != null) {
          CompoundRoot oldRoot = oldStack.getRoot();
          ValueStack currentStack = invocation.getStack();
          CompoundRoot root = currentStack.getRoot();
          root.addAll(0, oldRoot);
          LOG.debug("Restored stack");
        }
      }
      else {
        LOG.debug("Won't restore stack from event phase since it's a proper PRG request");
View Full Code Here

            this.action = action;
        }

        public void beforeResult(ActionInvocation invocation, String resultCode) {
            ValueStack stack = invocation.getStack();
            CompoundRoot root = stack.getRoot();

            boolean needsRefresh = true;
            Object newModel = action.getModel();

            // Check to see if the new model instance is already on the stack
            for (Object item : root) {
                if (item.equals(newModel)) {
                    needsRefresh = false;
                    break;
                }
            }

            // Add the new model on the stack
            if (needsRefresh) {

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

            return root;
        }

        if (root instanceof CompoundRoot) {
            // find real target
            CompoundRoot cr = (CompoundRoot) root;

            try {
                for (Object target : cr) {
                    if (
                            OgnlRuntime.hasSetProperty((OgnlContext) context, target, property)
View Full Code Here

    public static void setDevMode(String mode) {
        devMode = "true".equals(mode);
    }

    public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
        CompoundRoot root = (CompoundRoot) target;
        OgnlContext ognlContext = (OgnlContext) context;

        for (Object o : root) {
            if (o == null) {
                continue;
View Full Code Here

            }
        }
    }

    public Object getProperty(Map context, Object target, Object name) throws OgnlException {
        CompoundRoot root = (CompoundRoot) target;
        OgnlContext ognlContext = (OgnlContext) context;

        if (name instanceof Integer) {
            Integer index = (Integer) name;

            return root.cutStack(index.intValue());
        } else if (name instanceof String) {
            if ("top".equals(name)) {
                if (root.size() > 0) {
                    return root.get(0);
                } else {
                    return null;
                }
            }
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.util.CompoundRoot

Copyright © 2018 www.massapicom. 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.