亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? portletrequestimpl.java

?? portal越來越流行了
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.pluto.internal.impl;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.Vector;

import javax.ccpp.Profile;
import javax.portlet.PortalContext;
import javax.portlet.PortletMode;
import javax.portlet.PortletPreferences;
import javax.portlet.PortletRequest;
import javax.portlet.PortletSession;
import javax.portlet.WindowState;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.pluto.Constants;
import org.apache.pluto.OptionalContainerServices;
import org.apache.pluto.PortletContainer;
import org.apache.pluto.PortletEntity;
import org.apache.pluto.PortletWindow;
import org.apache.pluto.internal.InternalPortletContext;
import org.apache.pluto.internal.InternalPortletRequest;
import org.apache.pluto.internal.InternalPortletSession;
import org.apache.pluto.om.portlet.PortletDefinition;
import org.apache.pluto.om.portlet.SecurityRoleRef;
import org.apache.pluto.om.portlet.Supports;
import org.apache.pluto.spi.PortletURLProvider;
import org.apache.pluto.spi.optional.PortletEnvironmentService;
import org.apache.pluto.spi.optional.RequestAttributeService;
import org.apache.pluto.util.ArgumentUtility;
import org.apache.pluto.util.Enumerator;
import org.apache.pluto.util.StringManager;
import org.apache.pluto.util.StringUtils;


/**
 * Abstract <code>javax.portlet.PortletRequest</code> implementation.
 * This class also implements InternalPortletRequest.
 *
 */
public abstract class PortletRequestImpl extends HttpServletRequestWrapper
                implements PortletRequest, InternalPortletRequest 
{
    private static final Log LOG = LogFactory.getLog(PortletRequestImpl.class);
    
    private static final StringManager EXCEPTIONS =
            StringManager.getManager(PortletRequestImpl.class.getPackage().getName());
    
    /**
     * Cache for parsed dateHeader values.
     */
    protected static final HashMap<String,Long> dateHeaderParseCache = new HashMap<String,Long>();
    
    /**
     * The set of SimpleDateFormat formats to use in getDateHeader().
     *
     * Notice that because SimpleDateFormat is not thread-safe, we can't
     * declare formats[] as a static variable.
     */
    protected SimpleDateFormat dateHeaderFormats[] = {
        new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US),
        new SimpleDateFormat("EEEEEE, dd-MMM-yy HH:mm:ss zzz", Locale.US),
        new SimpleDateFormat("EEE MMMM d HH:mm:ss yyyy", Locale.US)
    };
    
    // Private Member Variables ------------------------------------------------
    
    /** The parent container within which this request was created. */
    protected PortletContainer container;
    
    /** The portlet window which is the target of this portlet request. */
    protected PortletWindow portletWindow;

    /**
     * The PortletContext associated with this Request. This PortletContext must
     * be initialized from within the <code>PortletServlet</code>.
     */
    protected InternalPortletContext portletContext;

    /** The PortalContext within which this request is occuring. */
    protected PortalContext portalContext;

    /** The portlet session. */
    private InternalPortletSession portletSession;

    /** Response content types. */
    protected Vector<String> contentTypes;
    
    /** FIXME: do we really need this?
     * Flag indicating if the HTTP-Body has been accessed. */
    protected boolean bodyAccessed = false;

    /** True if we are in an include call. */
    protected boolean included = false;
    
    /** True if we are in an forwarded call. */
    protected boolean forwarded = false;
    
    protected boolean namedRequestDispatcher;
    
    /** The corresponding servlet request. */
    protected HttpServletRequest servletRequest = null;
       
    protected PortletPreferences portletPreferences;

    protected PortletURLProvider urlProvider;
    
    protected Map<String, String[]> parameters = null;
    
    protected String queryString = null;
    
    // Constructors ------------------------------------------------------------

    public PortletRequestImpl(InternalPortletRequest internalPortletRequest) 
    {
        this(internalPortletRequest.getPortletContainer(),
             internalPortletRequest.getPortletWindow(),
             internalPortletRequest.getHttpServletRequest());
    }

    /**
     * Creates a PortletRequestImpl instance.
     * @param container  the portlet container.
     * @param portletWindow  the internal portlet window.
     * @param servletRequest  the underlying servlet request.
     */
    public PortletRequestImpl(PortletContainer container,
                              PortletWindow portletWindow,
                              HttpServletRequest servletRequest) 
    {
        super(servletRequest);
        this.container = container;
        this.portletWindow = portletWindow;
        this.portalContext = container.getRequiredContainerServices().getPortalContext();
        this.servletRequest = servletRequest;
        this.urlProvider = container
        .getRequiredContainerServices()
        .getPortalCallbackService()
        .getPortletURLProvider(getHttpServletRequest(), portletWindow);        
    }
    
    protected abstract Integer getRequestMethod();

    // PortletRequest Impl -----------------------------------------------------

    /* (non-Javadoc)
	 * @see javax.portlet.PortletRequest#getWindowId()
	 */
	public String getWindowId() 
	{
		return portletWindow.getId().getStringId();
	}
    
    /**
     * Determine whether or not the specified WindowState is allowed for this
     * portlet.
     *
     * @param state the state in question
     * @return true if the state is allowed.
     */
    public boolean isWindowStateAllowed(WindowState state) 
    {
    	for (Enumeration<WindowState> en = portalContext.getSupportedWindowStates();
    			en.hasMoreElements(); ) 
    	{
            if (en.nextElement().toString().equalsIgnoreCase(state.toString())) 
            {
                return true;
            }
        }
        return false;
    }
    
    public boolean isPortletModeAllowed(PortletMode mode) 
    {
        return (isPortletModeAllowedByPortlet(mode)
                && isPortletModeAllowedByPortal(mode));
    }
    
    public PortletMode getPortletMode() 
    {
        return portletWindow.getPortletMode();
    }
    
    public WindowState getWindowState() 
    {
        return portletWindow.getWindowState();
    }
    
    public PortletSession getPortletSession() 
    {
        return getPortletSession(true);
    }
    
    /**
     * Returns the portlet session.
     * <p>
     * Note that since portlet request instance is created everytime the portlet
     * container receives an incoming request, the portlet session instance held
     * by the request instance is also re-created for each incoming request.
     * </p>
     */
    public PortletSession getPortletSession(boolean create) 
    {
        if (LOG.isDebugEnabled()) 
        {
            LOG.debug("Retreiving portlet session (create=" + create + ")");
        }
        //
        // It is critical that we don't retrieve the portlet session until the
        //   cross context dispatch has been completed.  If we do then we risk
        //   having a cached version which is invalid for the context within
        //   which it exists.
        //
        if (portletContext == null) 
        {
            throw new IllegalStateException(
                    EXCEPTIONS.getString("error.session.illegalState"));
        }
        //
        // We must make sure that if the session has been invalidated (perhaps
        //   through setMaxIntervalTimeout()) and the underlying request
        //   returns null that we no longer use the cached version.
        // We have to check (ourselves) if the session has exceeded its max
        //   inactive interval. If so, we should invalidate the underlying
        //   HttpSession and recreate a new one (if the create flag is set to
        //   true) -- We just cannot depend on the implementation of
        //   javax.servlet.http.HttpSession!
        //
        HttpSession httpSession = getHttpServletRequest().getSession(create);
        if (httpSession != null) 
        {
        	// HttpSession is not null does NOT mean that it is valid.
            int maxInactiveInterval = httpSession.getMaxInactiveInterval();
            long lastAccesstime = httpSession.getLastAccessedTime();//lastAccesstime checks added for PLUTO-436
            if (maxInactiveInterval >= 0 && lastAccesstime > 0) 
            {    // < 0 => Never expires.
                long maxInactiveTime = httpSession.getMaxInactiveInterval() * 1000L;
                long currentInactiveTime = System.currentTimeMillis() - lastAccesstime;
                if (currentInactiveTime > maxInactiveTime) 
                {
                    if (LOG.isDebugEnabled()) 
                    {
                        LOG.debug("The underlying HttpSession is expired and "
                            + "should be invalidated.");
                    }
                    httpSession.invalidate();
                    httpSession = getHttpServletRequest().getSession(create);
                    //Added for PLUTO-436
                    // a cached portletSession is no longer useable.
                    // a new one will be created below.
                    portletSession = null;
                }
            }
        }
        if (httpSession == null) 
        {
            if (LOG.isDebugEnabled()) 
            {
                LOG.debug("The underlying HttpSession is not available: "
                		+ "no session will be returned.");
            }
            return null;
        }
        //
        // If we reach here, we are sure that the underlying HttpSession is
        //   available. If we haven't created and cached a portlet session
        //   instance, we will create and cache one now.
        //
        if (portletSession == null) 
        {
        	if (LOG.isDebugEnabled()) 
        	{
        		LOG.debug("Creating new portlet session...");
        	}
            final OptionalContainerServices optionalContainerServices = container.getOptionalContainerServices();
            final PortletEnvironmentService portletEnvironmentService = optionalContainerServices.getPortletEnvironmentService();
            
            portletSession = portletEnvironmentService.createPortletSession(container, 
                                                                            getHttpServletRequest(),
                                                                            portletContext, 
                                                                            httpSession, 
                                                                            portletWindow);
        }        
        return portletSession;
    }
    
    public String getProperty(String name)
    {
    	ArgumentUtility.validateNotNull("propertyName", name);
        String property = this.getHttpServletRequest().getHeader(name);
        if (property == null) 
        {
            Map<String, String[]> propertyMap = container.getRequiredContainerServices()
                    .getPortalCallbackService().getRequestPropertyProvider()
                    .getProperties(
                    		getHttpServletRequest(),
                    		portletWindow);

            if (propertyMap != null) 
            {
                String[] properties = (String[]) propertyMap.get(name);
                if (properties != null && properties.length > 0) 
                {
                	property = properties[0];
                }
            }
        }
        return property;
    }

    public Enumeration<String> getProperties(String name) 
    {
    	ArgumentUtility.validateNotNull("propertyName", name);
        Set<String> v = new HashSet<String>();
        Enumeration<String> props = this.getHttpServletRequest().getHeaders(name);
        if (props != null) 
        {
            while (props.hasMoreElements()) 
            {
                v.add(props.nextElement());
            }
        }

        // get properties from PropertyManager
        Map<String, String[]> map = container.getRequiredContainerServices()
                .getPortalCallbackService().getRequestPropertyProvider().getProperties(getHttpServletRequest(), portletWindow);
        if (map != null) 
        {
            String[] properties = (String[]) map.get(name);

            if (properties != null) 
            {
                // add properties to vector
                for (int i = 0; i < properties.length; i++) 
                {
                    v.add(properties[i]);
                }
            }
        }
        return new Enumerator(v.iterator());
    }

    public Enumeration<String> getPropertyNames() 
    {
        Set<String> v = new HashSet<String>();

        // get properties from PropertyManager
        Map<String, String[]> map = container.getRequiredContainerServices()
                .getPortalCallbackService().getRequestPropertyProvider()
                .getProperties(getHttpServletRequest(), portletWindow);

        if (map != null) 
        {
            v.addAll(map.keySet());
        }

        // get properties from request header
        Enumeration<String> props = this.getHttpServletRequest().getHeaderNames();
        if (props != null) 
        {
            while (props.hasMoreElements()) 
            {
                v.add(props.nextElement());
            }
        }
        return new Enumerator(v.iterator());
    }

    public PortalContext getPortalContext() 
    {
        return container.getRequiredContainerServices().getPortalContext();
    }

    public String getAuthType() 
    {
        return this.getHttpServletRequest().getAuthType();
    }

    public String getContextPath() 
    {
        return portletContext.getContextPath();
    }

    public String getRemoteUser() 
    {
        return this.getHttpServletRequest().getRemoteUser();
    }

    public Principal getUserPrincipal() 
    {
        return this.getHttpServletRequest().getUserPrincipal();
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷综合另类小说色区| 另类小说一区二区三区| 欧美一区二区三区成人| 欧美久久久久久久久中文字幕| 国产精品伊人色| 一本大道综合伊人精品热热| 欧美一区二区三区在线视频| 亚洲视频在线观看三级| 久久精品国产免费看久久精品| 91麻豆国产精品久久| 亚洲欧美另类图片小说| 欧美一区二区精品在线| 琪琪久久久久日韩精品| 欧洲精品中文字幕| av电影天堂一区二区在线 | 伊人夜夜躁av伊人久久| 蜜桃视频在线观看一区| 在线这里只有精品| 欧美韩国日本综合| 久久99久久久久久久久久久| 欧美在线色视频| 精品国产免费一区二区三区香蕉 | 国产在线精品一区二区不卡了| 色菇凉天天综合网| 1区2区3区国产精品| 国产精品影视网| 久久久777精品电影网影网| 美女视频黄 久久| 制服.丝袜.亚洲.中文.综合| 亚洲1区2区3区视频| 91免费观看国产| 国产女人18水真多18精品一级做| 久久精品国产亚洲一区二区三区| 欧美日韩免费在线视频| 亚洲自拍偷拍麻豆| 欧美性高清videossexo| 亚洲午夜私人影院| 色8久久人人97超碰香蕉987| 亚洲黄一区二区三区| 高清在线观看日韩| 欧美高清在线视频| 国产成人免费在线视频| 日本一区二区三级电影在线观看| 国产精品一区二区久激情瑜伽| 日韩欧美电影一二三| 日韩黄色免费网站| 日韩精品一区二区三区四区视频 | 中文字幕亚洲成人| youjizz国产精品| 中文字幕人成不卡一区| 国产精一区二区三区| 色伊人久久综合中文字幕| 亚洲欧美偷拍另类a∨色屁股| 国产一区二区三区四| 欧美v亚洲v综合ⅴ国产v| 国产一二三精品| 精品国产成人系列| 国产夫妻精品视频| 亚洲精品一卡二卡| 欧美日韩一区二区在线视频| 亚洲成人先锋电影| 欧美精品一区二区三区四区 | 久久伊人中文字幕| 成人av一区二区三区| 亚洲一二三四区不卡| 欧美岛国在线观看| 国产精品69毛片高清亚洲| 亚洲你懂的在线视频| 欧美吻胸吃奶大尺度电影| 日韩国产欧美在线观看| 精品福利视频一区二区三区| 国产精品99精品久久免费| 亚洲日本在线天堂| 欧美一级夜夜爽| 成人性生交大片| 一区二区在线免费| 欧美精品一区二区三区在线| 91国产丝袜在线播放| 麻豆91精品91久久久的内涵| 国产精品久久久久久久午夜片| 欧美在线观看一二区| 婷婷丁香激情综合| 日本一区二区三区高清不卡| 91精品国产综合久久精品图片 | 亚洲一区二区欧美日韩| 久久久精品日韩欧美| 色悠悠亚洲一区二区| 精品一区二区三区免费视频| 亚洲人成在线观看一区二区| 欧美日本精品一区二区三区| 国产成人精品三级| 亚洲成人动漫一区| 国产精品九色蝌蚪自拍| 欧美电视剧在线看免费| 日本道色综合久久| 国产91色综合久久免费分享| 蜜臀av性久久久久蜜臀aⅴ| 一区二区三区资源| 中文字幕五月欧美| 国产精品久久午夜| 欧美大胆人体bbbb| 色婷婷av一区二区三区软件| 国产成人av电影在线| 美国毛片一区二区| 日本一不卡视频| 樱花草国产18久久久久| 亚洲伦在线观看| 国产视频一区二区在线观看| 精品乱码亚洲一区二区不卡| 91精品国产入口| 欧美乱妇一区二区三区不卡视频| 北岛玲一区二区三区四区| 丁香婷婷综合激情五月色| 成人在线一区二区三区| 成人午夜视频网站| 国产成人在线看| 国产成人精品免费看| 美女在线一区二区| 另类小说欧美激情| 麻豆精品新av中文字幕| 久久成人免费电影| 狠狠狠色丁香婷婷综合激情| 韩国v欧美v亚洲v日本v| 国产一区二区h| 韩国av一区二区三区四区| 午夜欧美一区二区三区在线播放| 亚洲一区二区三区视频在线播放| 亚洲国产日韩av| 日韩国产精品久久久| 蜜臀av性久久久久蜜臀aⅴ| 九九九久久久精品| 成人一区二区三区| 在线看国产一区二区| 欧美日韩高清一区| 精品日韩在线观看| 久久久久国产精品人| 国产精品久久久久影视| 亚洲综合一区在线| 亚洲一区二区三区国产| 日韩和欧美一区二区三区| 麻豆精品视频在线观看视频| 成人福利视频在线| 91福利在线免费观看| 欧美一区二区视频网站| 国产亚洲午夜高清国产拍精品| 国产精品久久久久久久第一福利| 一区二区激情小说| 日韩精品乱码免费| 成人午夜又粗又硬又大| 欧美日韩三级一区二区| 日韩欧美三级在线| 久久精品视频在线看| 亚洲三级免费观看| 韩国精品主播一区二区在线观看| 国产成人av电影免费在线观看| 91网站最新网址| 91精品麻豆日日躁夜夜躁| 久久精品亚洲乱码伦伦中文 | 在线亚洲+欧美+日本专区| 欧美一级欧美三级| 国产欧美一区二区三区沐欲| 最好看的中文字幕久久| 日本成人在线不卡视频| av日韩在线网站| 日韩欧美电影一二三| 亚洲一二三专区| 国产盗摄一区二区| 欧美美女一区二区| 亚洲国产精品国自产拍av| 蜜臀av一级做a爰片久久| 色素色在线综合| 精品国内片67194| 亚洲综合成人在线| 国产福利一区二区三区在线视频| 欧美日韩一区二区三区在线看| 国产欧美一区视频| 日韩综合小视频| 日本精品一级二级| 国产精品久久久久久久午夜片| 国产一区二区主播在线| 欧美一二三区在线| 亚洲曰韩产成在线| 91首页免费视频| 国产免费观看久久| 国产精选一区二区三区| 欧美一级日韩一级| 午夜一区二区三区在线观看| 99视频在线观看一区三区| 国产性色一区二区| 久久se精品一区精品二区| 在线成人免费观看| 香港成人在线视频| 欧美日韩情趣电影| 亚洲bt欧美bt精品| 欧美日韩国产综合一区二区 | 精品视频999| 亚洲小说春色综合另类电影| 色哟哟亚洲精品| 亚洲精品videosex极品| 丁香网亚洲国际|