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

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

?? abstractservicer.java

?? 歡迎使用 FastJsp 開發框架! 編譯說明: * 若要生成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;


/**
 * 缺省服務
 *
 * @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的實現。WAS是須實現:.IServletRequest 嗎?將來再測。 
    WAS Server forward后會更改request.getRequestURL()為實際路徑的url,
    如:http://www.example.com:9080/onet/onetforums/web/club/default/messages.jsp,與標準不一致。
    此參數因為當前  request.getRequestURL() 無法 facade ,不得不硬性實現為 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 ------------------------");*/

    }

    /**
     * 執行當前jsp頁面服務
     *
     * @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*/) {

                /* 獲取當前布局 */
                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中已經基于 URLDecoder.decode(s,s)解碼,這里不再需要了。
            if (r != null)
                r = new String(r.getBytes(Constants.ISO_8859_1), module.charset);       //編碼中文等亞洲雙字節url參數
        } 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;
            }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美主播一区二区三区| 欧美一区二区成人| 欧美日本韩国一区| 国产欧美一区二区三区网站 | 色综合天天视频在线观看| 欧美一级夜夜爽| 亚洲主播在线播放| 成人18视频日本| 精品国产自在久精品国产| 亚洲国产日韩av| 亚洲色图视频网| 久久av中文字幕片| 91成人免费在线| 中文字幕不卡三区| 久久精品国产在热久久| 欧美日韩国产在线播放网站| 综合自拍亚洲综合图不卡区| 国产精品 欧美精品| 26uuu色噜噜精品一区二区| 日日夜夜免费精品视频| 欧美综合色免费| 亚洲精品一卡二卡| 一本大道综合伊人精品热热| 国产精品久久久久桃色tv| 国产99久久精品| 国产视频在线观看一区二区三区 | 一本色道久久综合亚洲91 | 成人妖精视频yjsp地址| 久久品道一品道久久精品| 久久成人久久鬼色| 精品99999| 国产在线观看一区二区| 久久嫩草精品久久久精品| 国产一区中文字幕| 国产欧美一区视频| 波多野结衣中文字幕一区二区三区| 久久久国产综合精品女国产盗摄| 精品一区二区三区欧美| 久久亚洲精精品中文字幕早川悠里| 久久国产精品一区二区| 精品国产乱码久久久久久牛牛| 九九九久久久精品| 欧美激情一区二区三区在线| 成人激情av网| 亚洲综合色网站| 宅男在线国产精品| 国产精品正在播放| 亚洲图片欧美激情| 欧美视频完全免费看| 秋霞午夜鲁丝一区二区老狼| 欧美xfplay| www.欧美日韩国产在线| 亚洲午夜一区二区| 久久综合九色综合欧美亚洲| 成人av集中营| 亚洲国产aⅴ成人精品无吗| 日韩免费性生活视频播放| 国产成人在线网站| 亚洲国产综合人成综合网站| 日韩欧美高清一区| eeuss鲁一区二区三区| 亚洲福利一区二区| 久久综合狠狠综合久久综合88| 99久久国产综合精品女不卡| 性做久久久久久| 国产精品久久久久9999吃药| 欧美日韩第一区日日骚| 成人精品高清在线| 日本一道高清亚洲日美韩| 国产视频不卡一区| 欧美一级精品在线| 99久久精品久久久久久清纯| 蜜臀精品久久久久久蜜臀| 国产精品欧美一区喷水| 制服丝袜亚洲色图| 91最新地址在线播放| 麻豆国产精品一区二区三区| 亚洲欧美激情在线| 日韩午夜在线影院| 在线一区二区三区| 国产凹凸在线观看一区二区| 午夜不卡av免费| 中文字幕欧美一区| 久久久亚洲精华液精华液精华液| 在线亚洲高清视频| youjizz久久| 国产999精品久久久久久 | 一区二区三区在线免费视频| 2021国产精品久久精品| 在线综合+亚洲+欧美中文字幕| 91蜜桃网址入口| 懂色av一区二区在线播放| 蜜桃av一区二区在线观看| 亚洲成人资源网| 一区二区三区四区高清精品免费观看| 久久色.com| 欧美一级片在线看| 欧美精品tushy高清| 欧美性生活影院| 日本韩国欧美三级| 94-欧美-setu| 91免费小视频| 色悠悠亚洲一区二区| 99久久99久久久精品齐齐| 国产成人综合亚洲网站| 国产精品一区二区久久不卡| 精品一区二区三区在线观看国产 | 亚洲精品视频在线看| 中文字幕欧美三区| 国产日韩欧美精品在线| 久久在线免费观看| 久久久亚洲精华液精华液精华液| 精品蜜桃在线看| 久久久国产精品午夜一区ai换脸| 亚洲伦理在线精品| 国产精品久久久久久一区二区三区| 国产亚洲一区字幕| 国产婷婷一区二区| 国产精品久久久久影视| 亚洲视频在线一区| 一区二区久久久久久| 亚洲一级二级三级| 日韩中文字幕区一区有砖一区 | a在线播放不卡| 99久久亚洲一区二区三区青草| av电影一区二区| 一本久久综合亚洲鲁鲁五月天 | 狠狠狠色丁香婷婷综合久久五月| 喷水一区二区三区| 国产自产v一区二区三区c| 国产精品一二一区| 国产精品主播直播| 欧美v日韩v国产v| 久久久久久久久久久久久夜| 欧美国产日产图区| 亚洲免费观看高清完整| 婷婷夜色潮精品综合在线| 麻豆精品一二三| 处破女av一区二区| 欧美中文字幕一区二区三区 | 欧美亚洲日本国产| 日韩一区二区不卡| 欧美激情一区二区三区全黄| 亚洲激情自拍偷拍| 久久99精品国产91久久来源| 丁香激情综合五月| 欧美群妇大交群的观看方式| www一区二区| 一区二区国产盗摄色噜噜| 免费成人在线观看视频| 不卡一区二区在线| 91精品国产一区二区三区香蕉| 久久九九久精品国产免费直播| 亚洲啪啪综合av一区二区三区| 蜜臀va亚洲va欧美va天堂| 高清beeg欧美| 欧美日本一区二区三区四区 | 爽爽淫人综合网网站| 国产99久久久精品| 欧美日韩国产a| ㊣最新国产の精品bt伙计久久| 五月天一区二区三区| 国产99久久精品| 日韩一级片网站| 一区二区三区鲁丝不卡| 国产精品中文欧美| 日韩欧美国产综合一区| 亚洲日本va午夜在线影院| 国产在线播放一区| 欧美精品久久天天躁| 最新国产成人在线观看| 国产一区三区三区| 欧美一区二区三区四区在线观看| 91精品国产91久久久久久一区二区 | 91麻豆视频网站| www国产精品av| 日韩一区精品字幕| 色噜噜久久综合| 中文字幕一区二区三区色视频| 久久激情五月婷婷| 欧美一区二区三区四区五区 | 中文字幕一区免费在线观看| 精品中文av资源站在线观看| 欧美日韩国产在线播放网站| 亚洲女厕所小便bbb| 成人黄色小视频在线观看| 久久综合资源网| 国产一区二区伦理片| 精品日韩一区二区| 久久成人羞羞网站| 26uuu欧美| 国产精品一二一区| 国产精品欧美经典| 97精品久久久久中文字幕| 日本一区二区电影| eeuss国产一区二区三区| 中文字幕在线不卡视频| 91色.com| 亚洲一二三区在线观看| 欧美日韩一卡二卡|