Package com.opensymphony.xwork2.ognl

Examples of com.opensymphony.xwork2.ognl.OgnlValueStackTest$Country


    }
   
    protected Object getActionObject(String name)
    {
        // Get the object key
        ActionContext context = ActionContext.getContext();
        String key = getActionObjectName(context, name);
        if (key==null)
            return null;
        // Get the object from the session
        return context.getSession().get(key);
    }
View Full Code Here


        return context.getSession().get(key);
    }
   
    protected void putActionObject(String name, Object item)
    {   // Put object
        ActionContext context = ActionContext.getContext();
        String key = getActionObjectName(context, name);
        if (key!=null)
            context.getSession().put(key, item);
    }
View Full Code Here

            context.getSession().put(key, item);
    }
   
    protected void removeActionObject(String name)
    {   // Clear object
        ActionContext context = ActionContext.getContext();
        String key = getActionObjectName(context, name);
        if (key!=null)
            context.getSession().remove(key);
    }
View Full Code Here

    public Object getActionBean(Class<?> objClass, boolean create, String ownerProperty)
    {
        if (objClass==null)
            return null;
        // get the object key
        ActionContext context = ActionContext.getContext();
        String key = getActionBeanName(context, objClass, ownerProperty);
        if (key==null)
            return null;
        // get the object from the session
        Object obj = context.getSession().get(key);
        if (obj==null && create)
        {   try {
                obj = objClass.newInstance();
                context.getSession().put(key, obj);
            } catch(Exception e) {
                log.error("Cannot create Instance of type " + objClass.getName(), e);
            }
        }
        return obj;
View Full Code Here

        {   // Error
            log.error("Unable to store object on session. Object is null, a primitive type or a string!");
            return;
        }   
        // Put object
        ActionContext context = ActionContext.getContext();
        String key = getActionBeanName(context, obj.getClass(), ownerProperty);
        if (key!=null)
            context.getSession().put(key, obj);
    }
View Full Code Here

   
    public void removeActionBean(Class<?> objClass, String propertyName)
    {
        if (objClass==null)
            return;
        ActionContext context = ActionContext.getContext();
        String key = getActionBeanName(context, objClass, propertyName);
        if (key!=null)
            context.getSession().remove(key);
    }
View Full Code Here

    public void clearActionErrors()
    {
        actionError = null;
        fieldErrors = null;
        // Remove from Session
        ActionContext context = ActionContext.getContext();
        if (context!=null)
            context.getSession().remove(LAST_ACTION_ERROR_ATTRIBUTE);
    }
View Full Code Here

    /*
     * @see org.apache.empire.struts2.action.ActionErrorProvider#getLastActionError(boolean)
     */
    public ErrorInfo getLastActionError(boolean clear)
    {
        ActionContext context = ActionContext.getContext();
        ErrorInfo error = (ErrorInfo)context.getSession().get(LAST_ACTION_ERROR_ATTRIBUTE);
        if (clear)
            context.getSession().remove(LAST_ACTION_ERROR_ATTRIBUTE);
        return error;
    }
View Full Code Here

        if (error instanceof ActionError)
            actionError = ((ActionError)error);
        else
            actionError = new ActionError(error);
        // put Error on session
        ActionContext context = ActionContext.getContext();
        context.getSession().put(LAST_ACTION_ERROR_ATTRIBUTE, actionError);
    }
View Full Code Here

    /*
     * @see org.apache.empire.struts2.action.ActionErrorProvider#getLastActionMessage(boolean)
     */
    public String getLastActionMessage(boolean clear)
    {
        ActionContext context = ActionContext.getContext();
        Object msg = context.getSession().get(LAST_ACTION_MESSAGE_ATTRIBUTE);
        if (clear)
            context.getSession().remove(LAST_ACTION_MESSAGE_ATTRIBUTE);
        return StringUtils.toString(msg);
    }
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.ognl.OgnlValueStackTest$Country

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.