001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.servlet;
016    
017    import java.util.Collections;
018    import java.util.Enumeration;
019    
020    import javax.servlet.ServletConfig;
021    import javax.servlet.ServletContext;
022    import javax.servlet.http.HttpServlet;
023    
024    /**
025     * @author Raymond Aug??
026     */
027    public class JSPSupportServlet extends HttpServlet {
028    
029            public JSPSupportServlet(ServletContext servletContext) {
030                    _servletContext = servletContext;
031    
032                    _servletConfig = new JSPSupportServletConfig();
033            }
034    
035            @Override
036            public ServletConfig getServletConfig() {
037                    return _servletConfig;
038            }
039    
040            @Override
041            public ServletContext getServletContext() {
042                    return _servletContext;
043            }
044    
045            private final ServletConfig _servletConfig;
046            private final ServletContext _servletContext;
047    
048            private class JSPSupportServletConfig implements ServletConfig {
049    
050                    @Override
051                    public String getInitParameter(String name) {
052                            return null;
053                    }
054    
055                    @Override
056                    public Enumeration<String> getInitParameterNames() {
057                            return Collections.enumeration(Collections.<String>emptyList());
058                    }
059    
060                    @Override
061                    public ServletContext getServletContext() {
062                            return _servletContext;
063                    }
064    
065                    @Override
066                    public String getServletName() {
067                            return JSPSupportServlet.class.getName();
068                    }
069    
070            }
071    
072    }