Search in sources :

Example 16 with org.apache.struts2.config

use of org.apache.struts2.config in project entando-core by entando.

the class InitOperations method initDispatcher.

@Override
public Dispatcher initDispatcher(HostConfig filterConfig) {
    Map<String, String> params = new HashMap<String, String>();
    for (Iterator<String> e = filterConfig.getInitParameterNames(); e.hasNext(); ) {
        String name = (String) e.next();
        String value = filterConfig.getInitParameter(name);
        params.put(name, value);
    }
    String struts2Config = filterConfig.getServletContext().getInitParameter(ApsAdminSystemConstants.STRUTS2_CONFIG_INIT_PARAM_NAME);
    if (null != struts2Config) {
        params.put("config", struts2Config);
    }
    Dispatcher dispatcher = new Dispatcher(filterConfig.getServletContext(), params);
    dispatcher.init();
    return dispatcher;
}
Also used : HashMap(java.util.HashMap) Dispatcher(org.apache.struts2.dispatcher.Dispatcher)

Example 17 with org.apache.struts2.config

use of org.apache.struts2.config in project entando-core by entando.

the class StrutsPrepareAndExecuteFilter method init.

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    InitOperations init = new InitOperations();
    Dispatcher dispatcher = null;
    try {
        FilterHostConfig config = new FilterHostConfig(filterConfig);
        init.initLogging(config);
        dispatcher = init.initDispatcher(config);
        init.initStaticContentLoader(config, dispatcher);
        this.prepare = new PrepareOperations(dispatcher);
        this.execute = new ExecuteOperations(dispatcher);
        this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
        this.postInit(dispatcher, filterConfig);
    } finally {
        if (dispatcher != null) {
            dispatcher.cleanUpAfterInit();
        }
        init.cleanup();
    }
}
Also used : FilterHostConfig(org.apache.struts2.dispatcher.filter.FilterHostConfig) ExecuteOperations(org.apache.struts2.dispatcher.ExecuteOperations) Dispatcher(org.apache.struts2.dispatcher.Dispatcher)

Aggregations

Config (sun.security.krb5.Config)8 Dispatcher (org.apache.struts2.dispatcher.Dispatcher)4 KrbException (sun.security.krb5.KrbException)3 ConfigurationException (com.opensymphony.xwork2.config.ConfigurationException)2 PackageConfig (com.opensymphony.xwork2.config.entities.PackageConfig)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 org.apache.struts2.config (org.apache.struts2.config)2 ExecuteOperations (org.apache.struts2.dispatcher.ExecuteOperations)2 Test (org.junit.Test)2 RequestContext (com.agiletec.aps.system.RequestContext)1 InitOperations (com.agiletec.apsadmin.system.dispatcher.InitOperations)1 PrepareOperations (com.agiletec.apsadmin.system.dispatcher.PrepareOperations)1 ActionConfig (com.opensymphony.xwork2.config.entities.ActionConfig)1 ResultTypeConfig (com.opensymphony.xwork2.config.entities.ResultTypeConfig)1 PropertyVetoException (java.beans.PropertyVetoException)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 PrintStream (java.io.PrintStream)1 Annotation (java.lang.annotation.Annotation)1