package org.seasar.struts.context;

import org.seasar.framework.container.S2Container;
import org.seasar.framework.container.factory.SingletonS2ContainerFactory;
import org.seasar.framework.util.Base64Util;
import org.seasar.struts.Constants;

/**
 * @author Satoshi Kimura
 */
public class S2StrutsContextImpl implements S2StrutsContext {
    private String path;

    public String getPath() {
        S2Container container = SingletonS2ContainerFactory.getContainer();
        String param = container.getRequest().getParameter(Constants.PAGE_NAME_ELEMENT_VALUE);

        if (param != null) {
            path = new String(Base64Util.decode(param));
        }

        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }
}
