Package com.struts2.gae.dispatcher

Source Code of com.struts2.gae.dispatcher.GaeInitOperations

package com.struts2.gae.dispatcher;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.ng.HostConfig;
import org.apache.struts2.dispatcher.ng.InitOperations;

public class GaeInitOperations extends InitOperations {

  @Override
  public Dispatcher initDispatcher(HostConfig filterConfig) {
    Dispatcher dispatcher = createDispatcher(filterConfig);
    dispatcher.init();
    return dispatcher;
  }

  private Dispatcher createDispatcher(HostConfig filterConfig) {
    Map<String, String> params = new HashMap<String, String>();
    for (Iterator e = filterConfig.getInitParameterNames(); e.hasNext();) {
      String name = (String) e.next();
      String value = filterConfig.getInitParameter(name);
      params.put(name, value);
    }
    return new GaeDispatcher(filterConfig.getServletContext(), params);
  }

}
TOP

Related Classes of com.struts2.gae.dispatcher.GaeInitOperations

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.