Example usage for com.liferay.portal.kernel.servlet DynamicServletConfig DynamicServletConfig

List of usage examples for com.liferay.portal.kernel.servlet DynamicServletConfig DynamicServletConfig

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.servlet DynamicServletConfig DynamicServletConfig.

Prototype

public DynamicServletConfig(ServletConfig servletConfig, Map<String, String> params) 

Source Link

Usage

From source file:com.liferay.util.bridges.php.PHPPortlet.java

License:Open Source License

protected synchronized void initQuercus(ServletConfig servletConfig) throws PortletException {

    if (quercusServlet == null) {
        try {//from w ww  .j  a  v  a2s.com
            quercusServlet = (HttpServlet) Class.forName(_QUERCUS_SERVLET).newInstance();

            Map<String, String> params = new HashMap<String, String>();

            Enumeration<String> enu = servletConfig.getInitParameterNames();

            while (enu.hasMoreElements()) {
                String name = enu.nextElement();

                if (!name.equals("portlet-class")) {
                    params.put(name, servletConfig.getInitParameter(name));
                }
            }

            servletConfig = new DynamicServletConfig(servletConfig, params);

            quercusServlet.init(servletConfig);
        } catch (Exception e) {
            throw new PortletException(e);
        }
    }
}