001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.util.JavaConstants;
018    
019    import java.util.HashSet;
020    import java.util.Set;
021    
022    /**
023     * @author Shuyang Zhou
024     */
025    public class RequestDispatcherAttributeNames {
026    
027            public static boolean contains(String name) {
028                    return _attributeNames.contains(name);
029            }
030    
031            private static final Set<String> _attributeNames = new HashSet<String>();
032    
033            static {
034                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_CONTEXT_PATH);
035                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_PATH_INFO);
036                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_QUERY_STRING);
037                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_REQUEST_URI);
038                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_SERVLET_PATH);
039                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_CONTEXT_PATH);
040                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_PATH_INFO);
041                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_QUERY_STRING);
042                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_REQUEST_URI);
043                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_SERVLET_PATH);
044            }
045    
046    }