Examples of XWorkConfigurationProvider


Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

        LocalizedTextUtil.addDefaultResourceBundle(Constants.BUNDLE_KEY);

        // Initialize ActionContext
        ConfigurationManager configurationManager = new ConfigurationManager();
        configurationManager.addContainerProvider(new XWorkConfigurationProvider());
        Configuration config = configurationManager.getConfiguration();
        Container container = config.getContainer();

        ValueStack stack = container.getInstance(ValueStackFactory.class).createValueStack();
        stack.getContext().put(ActionContext.CONTAINER, container);
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

    public void selfRegister() {
        //this cannot be done in the constructor, as it causes an infinite loop
        builder.factory(Configuration.class, MockConfiguration.class, Scope.SINGLETON);
        LocatableProperties props = new LocatableProperties();
        new XWorkConfigurationProvider().register(builder, props);
        builder.constant(XWorkConstants.DEV_MODE, "false");
        builder.constant(XWorkConstants.RELOAD_XML_CONFIGURATION, "true");
        builder.constant(XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE, "true");
        container = builder.create(true);
    }
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

     */
    public List<ContainerProvider> getContainerProviders() {
        providerLock.lock();
        try {
            if (containerProviders.size() == 0) {
                containerProviders.add(new XWorkConfigurationProvider());
                containerProviders.add(new XmlConfigurationProvider("xwork.xml", false));
            }

            return containerProviders;
        } finally {
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

        assertEquals(expected, actual);
    }

    public void testInsecureParamaters() throws Exception {
        // given
        loadConfigurationProviders(new XWorkConfigurationProvider(), new XmlConfigurationProvider("xwork-param-test.xml"));
        final Map<String, Object> params = new HashMap<String, Object>() {
            {
                put("name", "(#context[\"xwork.MethodAccessor.denyMethodExecution\"]= new " +
                        "java.lang.Boolean(false), #_memberAccess[\"allowStaticMethodAccess\"]= new java.lang.Boolean(true), " +
                        "@java.lang.Runtime@getRuntime().exec('mkdir /tmp/PWNAGE'))(meh)");
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

        throws Exception
    {
        super.setUp( );

        ConfigurationManager configurationManager = new ConfigurationManager( );
        configurationManager.addContainerProvider( new XWorkConfigurationProvider( ) );
        Configuration config = configurationManager.getConfiguration( );
        Container container = config.getContainer( );

        ValueStack stack = container.getInstance( ValueStackFactory.class ).createValueStack( );
        stack.getContext( ).put( ActionContext.CONTAINER, container );
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

        throws Exception
    {
        super.setUp();

        ConfigurationManager configurationManager = new ConfigurationManager();
        configurationManager.addContainerProvider( new XWorkConfigurationProvider() );
        com.opensymphony.xwork2.config.Configuration config = configurationManager.getConfiguration();
        Container container = config.getContainer();

        ValueStack stack = container.getInstance( ValueStackFactory.class ).createValueStack();
        stack.getContext().put( ActionContext.CONTAINER, container );
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

        assertEquals(expected, actual);
    }

    public void testInsecureParamaters() throws Exception {
        // given
        loadConfigurationProviders(new XWorkConfigurationProvider(), new XmlConfigurationProvider("xwork-param-test.xml"));
        final Map<String, Object> params = new HashMap<String, Object>() {
            {
                put("name", "(#context[\"xwork.MethodAccessor.denyMethodExecution\"]= new " +
                        "java.lang.Boolean(false), #_memberAccess[\"allowStaticMethodAccess\"]= new java.lang.Boolean(true), " +
                        "@java.lang.Runtime@getRuntime().exec('mkdir /tmp/PWNAGE'))(meh)");
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

        final String pollution3 = "model[\"class\"]['classLoader']['jarPath']";
        final String pollution4 = "class.classLoader.jarPath";
        final String pollution5 = "class['classLoader']['jarPath']";
        final String pollution6 = "class[\"classLoader\"]['jarPath']";

        loadConfigurationProviders(new XWorkConfigurationProvider(), new XmlConfigurationProvider("xwork-param-test.xml"));
        final Map<String, Object> params = new HashMap<String, Object>() {
            {
                put(pollution1, "bad");
                put(pollution2, "bad");
                put(pollution3, "bad");
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

     */
    public List<ContainerProvider> getContainerProviders() {
        providerLock.lock();
        try {
            if (containerProviders.size() == 0) {
                containerProviders.add(new XWorkConfigurationProvider());
                containerProviders.add(new XmlConfigurationProvider("xwork.xml", false));
            }

            return containerProviders;
        } finally {
View Full Code Here

Examples of com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider

        configProviderMock = new Mock(ConfigurationProvider.class);
        configProviderMock.matchAndReturn("equals", C.ANY_ARGS, false);

        ConfigurationProvider mockProvider = (ConfigurationProvider) configProviderMock.proxy();
        configurationManager.addContainerProvider(new XWorkConfigurationProvider());
        configurationManager.addContainerProvider(mockProvider);

        //the first time it always inits
        configProviderMock.expect("init", C.isA(Configuration.class));
        configProviderMock.expect("register", C.ANY_ARGS);
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.