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    import javax.portlet.MimeResponse;
023    
024    /**
025     * @author Shuyang Zhou
026     */
027    public class RequestDispatcherAttributeNames {
028    
029            public static boolean contains(String name) {
030                    return _attributeNames.contains(name);
031            }
032    
033            private static final Set<String> _attributeNames = new HashSet<String>();
034    
035            static {
036                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_CONTEXT_PATH);
037                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_PATH_INFO);
038                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_QUERY_STRING);
039                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_REQUEST_URI);
040                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_FORWARD_SERVLET_PATH);
041                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_CONTEXT_PATH);
042                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_PATH_INFO);
043                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_QUERY_STRING);
044                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_REQUEST_URI);
045                    _attributeNames.add(JavaConstants.JAVAX_SERVLET_INCLUDE_SERVLET_PATH);
046                    _attributeNames.add(MimeResponse.MARKUP_HEAD_ELEMENT);
047            }
048    
049    }