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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? abstractservicer.java

?? 歡迎使用 FastJsp 開發(fā)框架! 編譯說明: * 若要生成Api Javadoc文檔
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
// Copyright 2005-2007 onetsoft.com
//
// 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 com.onetsoft.fastjsp;

import com.onetsoft.fastjsp.request.PageData;
import com.onetsoft.fastjsp.util.Constants;
import com.onetsoft.fastjsp.util.ResourceResolver;
import com.onetsoft.fastjsp.util.StringUtils;
import com.onetsoft.fastjsp.util.Util;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.SystemUtils;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * 缺省服務(wù)
 *
 * @author <a href="mailto:hgw@onetsoft.com">hgw</a>
 * @since 2.0
 */
public abstract class AbstractServicer implements Servicer {

    private final static String SCRITPS_PATH = "/com/onetsoft/fastjsp/resource/scripts";
    private static Map frameworkResources = new HashMap(1);  //Contains framework resources

    FastJspServlet servlet = null;
    HttpServletRequest request = null;
    HttpServletResponse response = null;

    /*
    HttpServletRequest requestFacade = null; 對WAS無效,返回始終是:com.ibm.ws.webcontainer.srt.SRTServletRequest@74e074e0 ,似乎WAS不支持
    HttpSevletRequestWrapper的實現(xiàn)。WAS是須實現(xiàn):.IServletRequest 嗎?將來再測。 
    WAS Server forward后會更改request.getRequestURL()為實際路徑的url,
    如:http://www.example.com:9080/onet/onetforums/web/club/default/messages.jsp,與標(biāo)準(zhǔn)不一致。
    此參數(shù)因為當(dāng)前  request.getRequestURL() 無法 facade ,不得不硬性實現(xiàn)為 page.getRequestURL() 以兼容WAS server! 
    */
    String rawRequestedURL = null;

    Module module = null;         //current fastjsp web module
    String hostPath = null;         //e.g:"http://www.testsite.com:8080"
    String contextPath = null;    //e.g:"/onet"  or ""
    String servletContextPath = null;    //e.g:"/onet/forums"
    PageParamsImpl pageParams = null;

    PageModule[] layoutModules = null;
    PageModule defaultPageModule = null;

    StateURL stateURL = null;

    LinkPool linkPool=null;

    /**
     * Construct servicer
     *
     * @param servlet
     * @param request
     * @param response
     */
    public AbstractServicer(FastJspServlet servlet, HttpServletRequest request, HttpServletResponse response) {
        this.servlet = servlet;
        this.module = servlet.getModule();
        this.request = request;
        this.response = response;
        init();
    }

    private void init() {

        rawRequestedURL = request.getRequestURL().toString();
        this.hostPath = StringUtils.substringBeforeLast(rawRequestedURL, request.getRequestURI());
        this.contextPath = request.getContextPath();
        if (contextPath.length() == 1 && contextPath.charAt(0) == '/')
            contextPath = StringUtils.EMPTY;
        if (module.moduleServletPath == null)
            servletContextPath = contextPath;
        else
            servletContextPath = new StringBuffer().append(contextPath).append(request.getServletPath()).toString();

        if (servletContextPath.length() > 0 && servletContextPath.charAt(servletContextPath.length() - 1) == '/')
            servletContextPath = servletContextPath.substring(0, servletContextPath.length() - 1);

        stateURL = getURLState();


        /*    Debug.debug(" ----------- Context info begin ------------------------");
   Debug.debug("AbstractServicer.init() Line:96....hostPath:" + hostPath);
   Debug.debug("AbstractServicer.init() Line:97....contextPath:" + contextPath);
   Debug.debug("AbstractServicer.init() Line:98....servletContextPath:" + servletContextPath);
   Debug.debug("AbstractServicer.init() Line:99....module.urlExt:" + module.urlExt);
   Debug.debug("AbstractServicer.init() Line:99....raw contextPath:" + request.getContextPath());
   Debug.debug("AbstractServicer.init() Line:99....raw url:" + request.getRequestURL());
   Debug.debug("AbstractServicer.init() Line:99....raw uri:" + request.getRequestURI());
   Debug.debug("AbstractServicer.init() Line:100 ..raw servletPath:" + request.getServletPath());
   Debug.debug("AbstractServicer.init() Line:101 ..raw pathInfo:" + request.getPathInfo());
   Debug.debug(" ----------- Context info end ------------------------");*/

    }

    /**
     * 執(zhí)行當(dāng)前jsp頁面服務(wù)
     *
     * @throws ServletException
     * @throws IOException
     */
    protected void doService() throws ServletException, IOException {
        try {
            String pathinfo = getPathInfo(request);

            if (pathinfo == null || (pathinfo.length() == 1 && pathinfo.charAt(0) == '/') || pathinfo.endsWith(module.urlExt)
                    || pathinfo.indexOf('.') == -1  /*|| request.getServletPath().length() == 0*/) {

                /* 獲取當(dāng)前布局 */
                layoutModules = getLayoutModules();
                if (layoutModules == null || layoutModules.length == 0) {
                    outputNoLayoutInfo(getNoLayoutInfo());
                    return;
                }

                defaultPageModule = getDefaultLayoutModule();
                if (defaultPageModule == null)
                    defaultPageModule = layoutModules[0];
                if (!ArrayUtils.contains(layoutModules, defaultPageModule)) {
                    outputNoLayoutInfo("Default layout\"" + defaultPageModule + "\" is not exists in the layoutModules!");
                    return;
                }

                /* 處理頁面 */
                processPageService(pathinfo);

            } else if (pathinfo.startsWith(StringUtils.RESOURCE_URL_PREFIX)) {
                renderFrameworkReources(pathinfo);
            } else {
                renderContextReources(pathinfo);
            }
        } catch (ServletException e) {
            throw e;
        } catch (IOException e) {
            throw e;
        } catch (Exception e) {
            handleException(e);
        }
    }

    private String getPathInfo(HttpServletRequest request) {
        String uri = request.getRequestURI();
        uri = StringUtils.substringAfter(uri, contextPath);
        String r = null;
        if (module.moduleServletPath == null) {
            r = uri;
        } else {
            if (uri != null && uri.length() > module.moduleServletPath.length()) {
                r = uri.substring(module.moduleServletPath.length());
            }
        }
       /* try {
       PaeeParamsImpl中已經(jīng)基于 URLDecoder.decode(s,s)解碼,這里不再需要了。
            if (r != null)
                r = new String(r.getBytes(Constants.ISO_8859_1), module.charset);       //編碼中文等亞洲雙字節(jié)url參數(shù)
        } catch (UnsupportedEncodingException e) {
            throw new ApplicationRuntimeException(e);
        }*/
        return r;
    }

    protected String getNoLayoutInfo() {
        return "<b>NO WEB MODULES AVAILABLE</b>";
    }

    private void outputNoLayoutInfo(String info) {
        Writer out = null;
        try {
            out = new OutputStreamWriter(response.getOutputStream(), Constants.UTF_8);
            out.write(info);
            out.close();
            out = null;
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (out != null)
                try {
                    out.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
        }
    }

    private void processPageService(String pathInfo) throws IOException, ServletException {

      /*
        response.setHeader("Pragma", "No-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);*/

        AbstractPageService service = null;
        try {
            pageParams = new PageParamsImpl(this);
            pathInfo = stateURL.decodeBeforeDataBuild(pathInfo);
            pageParams.init(pathInfo);
            if (pageParams.layoutModule == Util.EMPTY_PAGE_MODULE) {
                /*if (getLayoutModules() == null || getLayoutModules().length == 0) {
                    outputNoLayoutInfo(getNoLayoutInfo());
                } else {*/
                response.sendError(HttpServletResponse.SC_NOT_FOUND, "NO LAYOUT FOUND!");
                /*   }*/
                return;
            } else if (pageParams.pageClass == null) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND, "NO PAGE CLASS FOUND:" + pageParams.pageClassStr);
                return;
            }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区四区在线免费观看| 色综合一个色综合| 亚洲图片欧美色图| 亚洲成av人片在www色猫咪| 国产精品区一区二区三区| 久久久综合精品| 久久精品无码一区二区三区| 久久先锋影音av鲁色资源网| 欧美蜜桃一区二区三区| 欧美挠脚心视频网站| 欧美日韩一卡二卡| 日韩一区国产二区欧美三区| 91精品国产麻豆| 日韩免费福利电影在线观看| 久久久亚洲高清| 国产精品视频你懂的| 亚洲精品亚洲人成人网在线播放| 亚洲与欧洲av电影| 美女视频黄免费的久久 | 国产精品国产自产拍高清av| 国产精品乱码一区二三区小蝌蚪| 中文在线一区二区| 一区二区三区免费看视频| 日韩激情av在线| 国产精品66部| 欧美日韩在线播放| xnxx国产精品| 玉米视频成人免费看| 日本欧美一区二区三区乱码| 国产成人丝袜美腿| 欧美系列一区二区| 三级在线观看一区二区| 国产一区二区三区免费| 成人精品国产免费网站| 欧美精品 国产精品| 久久精品视频免费观看| 亚洲伊人伊色伊影伊综合网| 经典三级在线一区| 欧美午夜精品久久久| 久久影院午夜论| 亚洲国产精品久久一线不卡| 国产精品亚洲专一区二区三区| 在线中文字幕不卡| 国产亚洲美州欧州综合国| 一区二区三区中文字幕电影 | 欧美视频在线一区二区三区| 日韩欧美视频一区| 亚洲乱码精品一二三四区日韩在线| 日韩电影在线观看一区| 99久久99久久久精品齐齐| 日韩欧美成人一区| 一区二区三区毛片| 成人av影视在线观看| 日韩三级中文字幕| 亚洲国产毛片aaaaa无费看| 成人污视频在线观看| 精品福利av导航| 日韩成人免费在线| 欧美视频精品在线| 亚洲精品中文在线| 91小视频在线| 国产精品成人免费精品自在线观看 | 日本亚洲一区二区| 欧美制服丝袜第一页| ㊣最新国产の精品bt伙计久久| 黄一区二区三区| 欧美一卡2卡3卡4卡| 亚洲超碰精品一区二区| 色婷婷av一区二区三区软件| 欧美一区二区三区在线看| 五月天一区二区| 欧美日韩国产不卡| 亚洲综合色自拍一区| 99精品热视频| 亚洲视频免费看| 日本韩国欧美三级| 亚洲成av人片一区二区三区| 日本精品视频一区二区| 洋洋成人永久网站入口| 91久久线看在观草草青青| 亚洲午夜在线电影| 91精品国产综合久久久久| 日本欧美一区二区| 精品久久国产老人久久综合| 激情小说亚洲一区| 国产日韩欧美综合一区| 国产成人aaa| 中文字幕在线观看一区二区| 99v久久综合狠狠综合久久| 国产精品成人网| 欧美日韩一二区| 久久精品免费观看| 国产欧美一区在线| 91亚洲男人天堂| 视频一区二区中文字幕| 久久亚洲综合色一区二区三区| 成人免费毛片片v| 亚洲午夜在线观看视频在线| 日韩丝袜美女视频| 国产成人精品网址| 亚洲国产精品麻豆| 国产亚洲精品精华液| 91免费看视频| 美国欧美日韩国产在线播放| 国产亚洲短视频| 成人h动漫精品一区二区| 亚洲国产精品一区二区久久恐怖片| 欧美日本乱大交xxxxx| 国内精品嫩模私拍在线| 一区二区三区.www| 久久一区二区视频| 色噜噜久久综合| 蜜桃视频第一区免费观看| 国产精品久久夜| 欧美日韩免费不卡视频一区二区三区| 久久精品国产澳门| 亚洲一区二区三区四区中文字幕 | 久久aⅴ国产欧美74aaa| 中文字幕在线观看一区二区| 欧美三级日本三级少妇99| 国产乱码一区二区三区| 天天综合色天天| 国产精品毛片久久久久久| 欧美另类久久久品| 91丨九色丨黑人外教| 国内精品国产三级国产a久久| 日韩毛片一二三区| 久久久www成人免费毛片麻豆| 欧美乱妇20p| 91成人免费在线视频| 国产成人福利片| 麻豆国产精品一区二区三区 | 奇米精品一区二区三区四区| 中文字幕在线不卡视频| wwww国产精品欧美| 欧美电影精品一区二区| 欧美福利视频一区| 在线影院国内精品| 色综合久久精品| 99在线热播精品免费| 国产一区二区三区不卡在线观看 | 亚洲欧美影音先锋| 国产午夜精品久久久久久久| 欧美成人猛片aaaaaaa| 91精品国产全国免费观看| 欧美亚洲高清一区二区三区不卡| av网站免费线看精品| 成人免费视频国产在线观看| 韩国在线一区二区| 国产在线播放一区| 国内精品伊人久久久久av影院| 精品一区二区三区免费观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 图片区日韩欧美亚洲| 五月天国产精品| 免费观看一级欧美片| 蜜臀av性久久久久蜜臀aⅴ| 免费高清在线一区| 蜜桃av一区二区| 国产一区二区成人久久免费影院 | 国产网红主播福利一区二区| 欧美精品一区二区三区四区| 欧美精品一区二区高清在线观看| 日韩视频免费观看高清完整版 | 亚洲日穴在线视频| 亚洲国产精品视频| 久久精品国产一区二区三区免费看| 久久精品国产一区二区三| 国产精品99久久久久久似苏梦涵| 国产精品1区2区3区在线观看| 高清久久久久久| 成人性生交大片免费看在线播放| 成人美女在线视频| 在线视频你懂得一区| 欧美精品电影在线播放| 欧美成人一区二区三区在线观看| 欧美一区二区成人| 国产精品日韩成人| 亚洲一区二区偷拍精品| 免费看日韩精品| 精品综合久久久久久8888| av在线不卡免费看| 欧美高清视频不卡网| 精品日韩一区二区三区| 国产精品久久久久影视| 亚瑟在线精品视频| 粉嫩av一区二区三区粉嫩| 色综合天天性综合| 欧美一级欧美三级| 国产精品视频看| 婷婷丁香激情综合| 成人亚洲一区二区一| 日韩无一区二区| 中文字幕一区二区三| 美女精品自拍一二三四| 欧美性生交片4| 久久天堂av综合合色蜜桃网| 亚洲成人av中文| av一本久道久久综合久久鬼色| 这里只有精品视频在线观看|