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

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

?? webpageconsoleservlet.java

?? jetspeed源代碼
?? JAVA
字號:
/*
 * Copyright 2000-2004 The Apache Software Foundation.
 * 
 * Licensed 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.jetspeed.services.webpage;

// java.util
import java.util.Properties;
import java.util.Collection;

// java.io
import java.io.IOException;
import java.io.FileNotFoundException;
import java.io.FileInputStream;

// javax.servlet
import javax.servlet.http.*;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletConfig;

// velocity
import org.apache.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.servlet.VelocityServlet;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.exception.ParseErrorException;


/**
  *
  * WebPageConsoleServlet is the main servlet entry point for the WebPage console. 
  *
  */

public class WebPageConsoleServlet extends VelocityServlet
{

    private String servletPath = null;
    private String proxyRoot = null;
    /*
     * Request Handler for a Velocity servlet. Includes the context.
     *
     * @param request Servlet request.
     * @param response Servlet response.
     * @context the velocity request context.
     * @exception IOException a servlet exception.
     * @exception ServletException a servlet exception.
     *     
     * @return The newly merged template.
     */
    public Template handleRequest( HttpServletRequest request, 
                                   HttpServletResponse response, 
                                   Context ctx )
    {
        if (servletPath == null)
        {
            servletPath = request.getServletPath();
            proxyRoot = getProxyHost(request);
        }
        
        boolean online = WebPageManager.isInit();
        if (online == false)
        {
            bootStrapProxy(request, response); // forward
        }

        String action = request.getParameter("action");
        String template;
        
        if (action == null)
            template = sessions(ctx);
        else if (action.equals("details"))
            template = elementSessions(ctx, request);
        else if (action.equals("test"))
            template = test(ctx, request);
        else if (action.equals("kill"))
            template = kill(ctx, request);
        else if (action.equals("killne"))
            template = killne(ctx);
        else if (action.equals("clear"))
            template = clear(ctx);
        else
            template = sessions(ctx);
                
        
        Template outty = null;
        
        try
        {
            outty =  getTemplate(template);
        }
        catch( ParseErrorException pee )
        {
            System.out.println("WebPageConsoleServlet : parse error for template " + pee);
        }
        catch( ResourceNotFoundException rnfe )
        {
            System.out.println("WebPageConsoleServlet : template not found " + rnfe);
        }
        catch( Exception e )
        {
            System.out.println("Error " + e);
        }
        return outty;

    }

    /**  
     *  Set the log file to be off of the webapp root, and
     *  will do the same with the file loader paths
     *
     * @param config The Servlet configuration.
     * @return The Properties collection of Velocity properties.
     * @throws exceptions when failed to read the properties or log files
     */        
    protected Properties loadConfiguration(ServletConfig config)
    throws IOException, FileNotFoundException
    {
        /*
         *  get our properties file and load it
         */

        String propsFile = config.getInitParameter(INIT_PROPS_KEY);

        Properties p = new Properties();

        if ( propsFile != null )
        {
            String realPath = getServletContext().getRealPath(propsFile);

            if ( realPath != null )
            {
                propsFile = realPath;
            }

            p.load( new FileInputStream(propsFile) );
        }

        /*
         *  first, normalize our velocity log file to be in the 
         *  webapp
         */

        String log = p.getProperty( Velocity.RUNTIME_LOG);

        if (log != null )
        {
            log = getServletContext().getRealPath( log );

            if (log != null)
            {
                p.setProperty( Velocity.RUNTIME_LOG, log );
            }
        }


        /*
         *  now, if there is a file loader resource path, treat it the
         *  same way.
         */

        String path = p.getProperty( Velocity.FILE_RESOURCE_LOADER_PATH );

        if ( path != null)
        {
            path = getServletContext().getRealPath(  path );

            if ( path != null)
            {
                p.setProperty( Velocity.FILE_RESOURCE_LOADER_PATH, path );
            }
        }

        return p;
    }  

    //////////////////////////////////////////////////////////////////////

    private String sessions(Context ctx)
    {
        // default Sessions screen

        Collection sessions = WebPageManager.getSessions();
        Collection targets = WebPageManager.getSites();
        boolean online = WebPageManager.isInit();

        ctx.put("sessions", sessions);
        ctx.put("targets", targets);  
        ctx.put("online", new Boolean(online));
        ctx.put("proxyError", WebPageManager.getErrorString());
        ctx.put("cmd", this);
        return "proxyConsole.vm";
    }

    //////////////////////////////////////////////////////////////////////

    private String elementSessions(Context ctx, HttpServletRequest request)
    {
        String sid = request.getParameter("id");

        if (sid == null)
        {
            return sessions(ctx);
        }
        // long id = Long.valueOf(sid).longValue();
        SessionMap map = WebPageManager.getSession(sid);
        if (map == null)
        {
            return sessions(ctx);
        }

        // default Sessions screen
        boolean online = WebPageManager.isInit();
    
        //Collection sessions = WebPageManager.getSessions();    
        //ctx.put("xxx_sessions", sessions );

        ctx.put("online", new Boolean(online));
        ctx.put("proxyError", WebPageManager.getErrorString());
        ctx.put("cmd", this);
        ctx.put("ne_sessions", map);

        return "neConsole.vm";  
    }
            
    //////////////////////////////////////////////////////////////////////

    private String kill(Context ctx, HttpServletRequest request)
    {
        // default Sessions screen
        boolean online = WebPageManager.isInit();
    
        Collection sessions = WebPageManager.getSessions();
        Collection elements = WebPageManager.getSites();
    
        ctx.put("xxx_sessions", sessions);
        ctx.put("elements", elements);  
        ctx.put("online", new Boolean(online));
        ctx.put("proxyError", WebPageManager.getErrorString());
        ctx.put("cmd", this);
        
        return "proxyConsole.vm";
    }

    //////////////////////////////////////////////////////////////////////

    private String killne(Context ctx)
    {
        return "proxyConsole.vm";
    }

    //////////////////////////////////////////////////////////////////////

    private String clear(Context ctx)
    {
        return "proxyConsole.vm";
    }

    //////////////////////////////////////////////////////////////////////
            
    private String test(Context ctx, HttpServletRequest request)
    {
        String id = request.getParameter("id");
        if (id == null)
        {
            return sessions(ctx);
        }
        SessionMap map = WebPageManager.getSession(id);
        if (map == null)
        {
            return sessions(ctx);
        }
        String ipa = request.getParameter("ipa");
        if (ipa == null)
        {
            return sessions(ctx);
        }
        SiteSession session = (SiteSession)map.get(ipa);
        if (session == null)
        {
            return sessions(ctx);
        }

        // default Sessions screen
        boolean online = WebPageManager.isInit();
    
        //Collection sessions = WebPageManager.getSessions();    
        //ctx.put("xxx_sessions", sessions );

        ctx.put("online", new Boolean(online));
        ctx.put("proxyError", WebPageManager.getErrorString());
        ctx.put("cmd", this);
        ctx.put("ne_sessions", map);
        //ctx.put("element", session.;
        ctx.put("nes", session);

        return "testConsole.vm";
    }

    //////////////////////////////////////////////////////////////////////
                  
    public String getRefresh()
    {
        return servletPath + "?action=refresh";
    }

    public String getClear()
    {
        return servletPath + "?action=clear";
    }

    public String getDetails()
    {
        return servletPath + "?action=details";
    }

    public String getTest()
    {
        return servletPath + "?action=test";
    }

    public String getKill()
    {
        return servletPath + "?action=kill";
    }

    public String getKillne()
    {
        return servletPath + "?action=killne";
    }

    public String getLogon()
    {
        String proxy = proxyRoot;
        Configuration config = Configuration.getInstance();
        proxy = proxy.concat("?logon-test=true&" + config.getSID() + "=");
        return proxy;
    }

    public String getProxyRoot()
    {
        return proxyRoot;
    }

    public String getWebapp()
    {
        Configuration config = Configuration.getInstance();
        return config.getWebapp();
        //return ProxyUtil.concatURLs(proxyRoot, config.getWebapp());
    }

    ////////////////////////////////////////////////////////////////////

    private String getProxyHost(HttpServletRequest request)
    {    
        StringBuffer root = new StringBuffer();
        String scheme = request.getScheme();
        root.append(scheme);
        root.append( "://");
        int port = request.getServerPort();
        root.append(request.getServerName());  
    
        if ( (port > 0) &&
             ((scheme.equals("http") && port != 80) ||
              (scheme.equals("https") && port != 443)
             )
           )
        {
            root.append(":");
            root.append(port);
        }
        root.append( Configuration.WPS_SERVLET );
        return root.toString();
    }

    //////////////////////////////////////////////////////////////

    void bootStrapProxy(HttpServletRequest request, 
                        HttpServletResponse response)
    {

        ServletContext ctx = getServletContext();

        try
        {
            RequestDispatcher dispatcher 
                                = ctx.getRequestDispatcher(Configuration.WPS_SERVLET);
            
            dispatcher.forward(request, response);
        } 
        catch (Exception e) 
        {
        }
    }
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情精品久久久第一区二区 | 欧美日韩在线一区二区| 国产露脸91国语对白| 天堂蜜桃91精品| 一区二区不卡在线播放 | 91看片淫黄大片一级在线观看| 国产在线精品一区二区不卡了 | 欧美精品亚洲一区二区在线播放| 97se亚洲国产综合自在线| 国产主播一区二区三区| 亚洲国产毛片aaaaa无费看| 久久精品夜夜夜夜久久| 日韩欧美国产麻豆| 欧美美女一区二区| 欧美伊人久久久久久午夜久久久久| www.亚洲国产| 成人美女视频在线看| 福利一区福利二区| 国产成人综合网站| 麻豆一区二区三| 久久精品国产精品亚洲红杏| 日本不卡123| 麻豆国产精品官网| 精品一区二区三区在线观看| 麻豆国产91在线播放| 另类欧美日韩国产在线| 久久国产精品区| 婷婷久久综合九色国产成人| 午夜伦理一区二区| 日韩高清电影一区| 琪琪久久久久日韩精品| 久久精品国产99国产| 国产一区二区在线观看免费| 91色porny在线视频| 国产一区二区三区免费观看| 精品午夜久久福利影院| 国产精品亚洲午夜一区二区三区 | eeuss鲁片一区二区三区| 成人激情免费电影网址| 成人国产亚洲欧美成人综合网| 99久久99久久综合| 在线亚洲人成电影网站色www| 欧美特级限制片免费在线观看| 欧美日韩国产系列| 欧美高清精品3d| 日韩免费高清视频| 久久免费视频一区| 亚洲蜜臀av乱码久久精品蜜桃| 亚洲欧美日韩在线| 午夜精品久久久久久久蜜桃app| 日本不卡一二三| 国产suv精品一区二区三区 | 国产亚洲制服色| 综合电影一区二区三区| 亚洲一二三四在线观看| 美女一区二区久久| eeuss鲁一区二区三区| 欧美日韩精品二区第二页| 精品99一区二区| 国产精品传媒视频| 日韩av在线免费观看不卡| 国产伦精品一区二区三区视频青涩 | 欧美日韩日本视频| 久久麻豆一区二区| 亚洲啪啪综合av一区二区三区| 亚洲福利视频三区| 国产成人一级电影| 成人国产亚洲欧美成人综合网| 99vv1com这只有精品| 51精品国自产在线| 欧美激情一区二区三区在线| 午夜精品久久久久久久久久久| 韩国精品在线观看| 91高清视频免费看| 久久综合久久综合久久综合| 国产精品动漫网站| 亚洲福中文字幕伊人影院| 国产精品一品二品| 欧美日韩精品系列| 国产精品大尺度| 久久99国内精品| 色综合久久中文字幕综合网| 777色狠狠一区二区三区| 国产精品久久久久桃色tv| 麻豆视频一区二区| 在线视频中文字幕一区二区| 欧美日韩免费在线视频| 日本一区二区三区视频视频| 美女脱光内衣内裤视频久久网站| 色综合 综合色| 国产蜜臀av在线一区二区三区| 天堂久久一区二区三区| 色综合中文字幕国产| 欧美猛男男办公室激情| 国产精品天干天干在线综合| 麻豆精品国产传媒mv男同 | 欧美激情艳妇裸体舞| 免费在线观看成人| 欧美日韩精品欧美日韩精品一 | 国产一区二区三区| 欧美一三区三区四区免费在线看 | av网站免费线看精品| xfplay精品久久| 亚洲 欧美综合在线网络| 99精品热视频| 欧美激情一区三区| 国产乱子伦视频一区二区三区 | 91精品国产免费| 亚洲男人电影天堂| 国产美女在线观看一区| 欧美大片在线观看| 日本va欧美va精品| 欧美精品 国产精品| 亚洲第一久久影院| 欧美日韩中文国产| 亚洲图片激情小说| 91在线视频在线| 亚洲欧美激情视频在线观看一区二区三区 | 欧美一区二区国产| 久久国产欧美日韩精品| 国产人伦精品一区二区| 99国内精品久久| 亚洲国产日韩一级| 欧美tickling挠脚心丨vk| 国产剧情一区二区三区| 亚洲欧洲无码一区二区三区| 欧美日韩亚洲国产综合| 青椒成人免费视频| 国产女人18毛片水真多成人如厕| 91免费看片在线观看| 日韩在线卡一卡二| 久久免费视频色| 91黄色激情网站| 蜜桃视频第一区免费观看| 国产性色一区二区| 91黄色激情网站| 久久99国产精品久久99果冻传媒| 日本一区二区不卡视频| 91黄视频在线| 国产在线乱码一区二区三区| 日韩一区欧美一区| 91精品国产高清一区二区三区 | 高清不卡一区二区| 亚洲国产综合在线| 欧美精品一区二区三区视频| 97国产一区二区| 久久成人免费日本黄色| 中文字幕在线一区| 91麻豆精品91久久久久同性| 高清成人免费视频| 日韩在线一区二区| 国产精品乱人伦| 日韩欧美中文字幕制服| 91在线观看污| 国产一区不卡在线| 亚洲第一福利视频在线| 国产欧美久久久精品影院| 欧美精三区欧美精三区| av在线这里只有精品| 美女视频黄频大全不卡视频在线播放| 国产精品人人做人人爽人人添 | 五月婷婷激情综合网| 国产精品沙发午睡系列990531| 91精品在线麻豆| 99国产欧美久久久精品| 国产在线播放一区三区四| 亚洲va在线va天堂| 中文字幕在线观看不卡| 欧美成人欧美edvon| 欧美在线综合视频| 成人精品一区二区三区四区| 九九**精品视频免费播放| 一个色妞综合视频在线观看| 亚洲国产精品v| 欧美成人vps| 欧美日韩黄色影视| 91色porny蝌蚪| 成人国产精品免费| 国产原创一区二区| 日韩**一区毛片| 亚洲成在人线在线播放| 亚洲色图欧美偷拍| 中文一区在线播放| 久久久青草青青国产亚洲免观| 欧美一区在线视频| 欧美美女网站色| 欧美三级电影网站| 在线视频综合导航| 91美女在线视频| aaa欧美日韩| www.日本不卡| 国产91丝袜在线18| 国产精品一区免费视频| 麻豆精品一二三| 麻豆极品一区二区三区| 免费成人你懂的| 欧美a级一区二区| 美国毛片一区二区三区| 秋霞电影一区二区| 日韩av不卡在线观看|