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

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

?? dwrpplainjsmarshaller.java

?? dwr 源文件 dwr 源文件 dwr 源文件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:

    /**
     * Send a script to the browser
     * @param out The stream to write to
     * @param script The script to send
     * @throws IOException If the write fails
     */
    protected void sendScript(PrintWriter out, String script) throws IOException
    {
        if (script.trim().length() == 0)
        {
            return;
        }

        synchronized (out)
        {
            out.println(ConversionConstants.SCRIPT_START_MARKER);
            out.println(script);
            out.println(ConversionConstants.SCRIPT_END_MARKER);

            if (out.checkError())
            {
                throw new IOException("Error flushing buffered stream"); //$NON-NLS-1$
            }
        }
    }

    /**
     * iframe mode starts as HTML, so get into script mode
     * @return A script prefix
     */
    protected String getOutboundMimeType()
    {
        return MimeConstants.MIME_PLAIN;
    }

    /**
     * iframe mode starts as HTML, so get into script mode
     * @param out The stream to write to
     * @throws IOException If the write fails
     */
    protected void sendOutboundScriptPrefix(PrintWriter out) throws IOException
    {
    }

    /**
     * iframe mode needs to get out of script mode
     * @param out The stream to write to
     * @throws IOException If the write fails
     */
    protected void sendOutboundScriptSuffix(PrintWriter out) throws IOException
    {
    }

    /**
     * Convert an exception into an outbound variable
     * @param th The exception to be converted
     * @param converted The conversion context
     * @return A new outbound exception
     */
    private OutboundVariable convertException(Throwable th, OutboundContext converted)
    {
        try
        {
            if (converterManager.isConvertable(th.getClass()))
            {
                return converterManager.convertOutbound(th, converted);
            }
        }
        catch (MarshallException ex)
        {
            log.warn("Exception while converting. Exception to be converted: " + th, ex); //$NON-NLS-1$
        }

        // So we will have to create one for ourselves
        OutboundVariable ov = new OutboundVariable();
        String varName = converted.getNextVariableName();
        ov.setAssignCode(varName);
        ov.setInitCode("var " + varName + " = \"" + JavascriptUtil.escapeJavaScript(th.getMessage()) + "\";"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

        return ov;
    }

    /**
     * Parse an inbound request into a Calls object
     * @param req The original browser's request
     * @return A parsed set of calls
     * @throws IOException If reading from the request body stream fails
     */
    private ParseResponse parseRequest(HttpServletRequest req) throws IOException
    {
        ParseResponse parseResponse = new ParseResponse();

        if (req.getMethod().equals("GET")) //$NON-NLS-1$
        {
            parseResponse.setAllParameters(parseGet(req));
        }
        else
        {
            parseResponse.setAllParameters(parsePost(req));
        }

        parseParameters(parseResponse);
        return parseResponse;
    }

    /**
     * Parse an HTTP POST request to fill out the scriptName, methodName and
     * paramList properties. This method should not fail unless it will not
     * be possible to return any sort of error to the user. Failure cases should
     * be handled by the <code>checkParams()</code> method.
     * @param req The original browser's request
     * @return The equivalent of HttpServletRequest.getParameterMap() for now
     * @throws IOException If reading from the request body stream fails
     */
    private Map parsePost(HttpServletRequest req) throws IOException
    {
        Map paramMap = new HashMap();

        // I've had reports of data loss in Tomcat 5.0 that relate to this bug
        //   http://issues.apache.org/bugzilla/show_bug.cgi?id=27447
        // See mails to users@dwr.dev.java.net:
        //   Subject: "Tomcat 5.x read-ahead problem"
        //   From: CAKALIC, JAMES P [AG-Contractor/1000]
        // It would be more normal to do the following:
        // BufferedReader in = req.getReader();
        BufferedReader in = new BufferedReader(new InputStreamReader(req.getInputStream()));

        while (true)
        {
            String line = in.readLine();

            if (line == null)
            {
                break;
            }

            if (line.indexOf('&') != -1)
            {
                // If there are any &s then this must be iframe post and all the
                // parameters have got dumped on one line, split with &
                log.debug("Using iframe POST mode"); //$NON-NLS-1$
                StringTokenizer st = new StringTokenizer(line, "&"); //$NON-NLS-1$
                while (st.hasMoreTokens())
                {
                    String part = st.nextToken();
                    part = LocalUtil.decode(part);

                    parsePostLine(part, paramMap);
                }
            }
            else
            {
                // Horay, this is a normal one!
                parsePostLine(line, paramMap);
            }
        }

        // If there is only 1 param then this must be a broken Safari. All
        // the parameters have got dumped on one line split with \n
        // See: http://bugzilla.opendarwin.org/show_bug.cgi?id=3565
        //      https://dwr.dev.java.net/issues/show_bug.cgi?id=93
        //      http://jira.atlassian.com/browse/JRA-8354
        //      http://developer.apple.com/internet/safari/uamatrix.html
        if (paramMap.size() == 1)
        {
            log.debug("Using Broken Safari POST mode"); //$NON-NLS-1$

            // This looks like a broken Mac where the line endings are confused

            // Iterators insist that we call hasNext() before we start
            Iterator it = paramMap.keySet().iterator();
            if (!it.hasNext())
            {
                throw new IllegalStateException("No entries in non empty map!"); //$NON-NLS-1$
            }

            // So get the first
            String key = (String) it.next();
            String value = (String) paramMap.get(key);
            String line = key + ConversionConstants.INBOUND_DECL_SEPARATOR + value;

            StringTokenizer st = new StringTokenizer(line, "\n"); //$NON-NLS-1$
            while (st.hasMoreTokens())
            {
                String part = st.nextToken();
                part = LocalUtil.decode(part);

                parsePostLine(part, paramMap);
            }
        }

        return paramMap;
    }

    /**
     * Sort out a single line in a POST request
     * @param line The line to parse
     * @param paramMap The map to add parsed parameters to
     */
    private void parsePostLine(String line, Map paramMap)
    {
        if (line.length() == 0)
        {
            return;
        }

        int sep = line.indexOf(ConversionConstants.INBOUND_DECL_SEPARATOR);
        if (sep == -1)
        {
            log.warn("Missing separator in POST line: " + line); //$NON-NLS-1$
        }
        else
        {
            String key = line.substring(0, sep);
            String value = line.substring(sep  + ConversionConstants.INBOUND_DECL_SEPARATOR.length());

            paramMap.put(key, value);
        }
    }

    /**
     * Parse an HTTP GET request to fill out the scriptName, methodName and
     * paramList properties. This method should not fail unless it will not
     * be possible to return any sort of error to the user. Failure cases should
     * be handled by the <code>checkParams()</code> method.
     * @param req The original browser's request
     * @return Simply HttpRequest.getParameterMap() for now
     * @throws IOException If the parsing fails
     */
    private Map parseGet(HttpServletRequest req) throws IOException
    {
        Map convertedMap = new HashMap();
        Map paramMap = req.getParameterMap();

        for (Iterator it = paramMap.keySet().iterator(); it.hasNext();)
        {
            String key = (String) it.next();
            String[] array = (String[]) paramMap.get(key);

            if (array.length == 1)
            {
                convertedMap.put(key, array[0]);
            }
            else
            {
                throw new IOException(Messages.getString("ExecuteQuery.MultiValues", key)); //$NON-NLS-1$
            }
        }

        return convertedMap;
    }

    /**
     * Fish out the important parameters
     * @param parseResponse The call details the methods we are calling
     * @throws IOException If the parsing of input parameter fails
     */
    private void parseParameters(ParseResponse parseResponse) throws IOException
    {
        Map paramMap = parseResponse.getAllParameters();
        Calls calls = new Calls();
        parseResponse.setCalls(calls);

        // Work out how many calls are in this packet
        String callStr = (String) paramMap.remove(ConversionConstants.INBOUND_CALL_COUNT);
        int callCount;
        try
        {
            callCount = Integer.parseInt(callStr);
        }
        catch (NumberFormatException ex)
        {
            throw new IOException(Messages.getString("ExecuteQuery.BadCallCount", callStr)); //$NON-NLS-1$
        }

        List inboundContexts = parseResponse.getInboundContexts();

        // Extract the ids, scriptnames and methodnames
        for (int callNum = 0; callNum < callCount; callNum++)
        {
            Call call = new Call();
            calls.addCall(call);

            InboundContext inctx = new InboundContext();
            inboundContexts.add(inctx);

            String prefix = ConversionConstants.INBOUND_CALLNUM_PREFIX + callNum + ConversionConstants.INBOUND_CALLNUM_SUFFIX;

            // The special values
            call.setId((String) paramMap.remove(prefix + ConversionConstants.INBOUND_KEY_ID));
            call.setScriptName((String) paramMap.remove(prefix + ConversionConstants.INBOUND_KEY_SCRIPTNAME));
            call.setMethodName((String) paramMap.remove(prefix + ConversionConstants.INBOUND_KEY_METHODNAME));

            // Look for parameters to this method
            for (Iterator it = paramMap.entrySet().iterator(); it.hasNext();)
            {
                Map.Entry entry = (Map.Entry) it.next();
                String key = (String) entry.getKey();

                if (key.startsWith(prefix))
                {
                    String data = (String) entry.getValue();
                    String[] split = LocalUtil.splitInbound(data);

                    String value = split[LocalUtil.INBOUND_INDEX_VALUE];
                    String type = split[LocalUtil.INBOUND_INDEX_TYPE];
                    inctx.createInboundVariable(callNum, key, type, value);
                    it.remove();
                }
            }
        }

        paramMap.remove(ConversionConstants.INBOUND_KEY_HTTP_SESSIONID);
        // Maybe we should check the value of this against the cookie value

        String scriptSessionId = (String) paramMap.remove(ConversionConstants.INBOUND_KEY_SCRIPT_SESSIONID);
        parseResponse.setScriptSessionId(scriptSessionId);

        String page = (String) paramMap.remove(ConversionConstants.INBOUND_KEY_PAGE);
        parseResponse.setPage(page);

        parseResponse.setSpareParameters(paramMap);
    }

    /* (non-Javadoc)
     * @see org.directwebremoting.Marshaller#isConvertable(java.lang.Class)
     */
    public boolean isConvertable(Class paramType)
    {
        return converterManager.isConvertable(paramType);
    }

    /**
     * Accessor for the DefaultCreatorManager that we configure
     * @param converterManager The new DefaultConverterManager
     */
    public void setConverterManager(ConverterManager converterManager)
    {
        this.converterManager = converterManager;
    }

    /**
     * Accessor for the DefaultCreatorManager that we configure
     * @param creatorManager The new DefaultConverterManager
     */
    public void setCreatorManager(CreatorManager creatorManager)
    {
        this.creatorManager = creatorManager;
    }

    /**
     * Accessor for the security manager
     * @param accessControl The accessControl to set.
     */
    public void setAccessControl(AccessControl accessControl)
    {
        this.accessControl = accessControl;
    }

    /**
     * How we convert parameters
     */
    protected ConverterManager converterManager = null;

    /**
     * How we create new beans
     */
    protected CreatorManager creatorManager = null;

    /**
     * The security manager
     */
    protected AccessControl accessControl = null;

    /**
     * How we stash away the request
     */
    protected static final String ATTRIBUTE_REQUEST = "org.directwebremoting.dwrp.request"; //$NON-NLS-1$

    /**
     * How we stash away the conduit
     */
    protected static final String ATTRIBUTE_CONDUIT = "org.directwebremoting.dwrp.conduit"; //$NON-NLS-1$

    /**
     * 
     */
    protected static final String ATTRIBUTE_PARSE_RESPONSE = "org.directwebremoting.dwrp.parseResponse"; //$NON-NLS-1$

    /**
     * The log stream
     */
    protected static final Logger log = Logger.getLogger(DwrpPlainJsMarshaller.class);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看日韩av先锋影音电影院| 丝袜美腿亚洲色图| 亚洲影院理伦片| 日韩成人免费电影| 国产精品一级在线| 在线精品观看国产| 精品理论电影在线观看| 国产欧美日韩综合精品一区二区| 亚洲精品中文字幕在线观看| 日韩不卡一区二区三区| 国产毛片精品一区| 91福利视频久久久久| 日韩视频免费观看高清完整版在线观看 | 懂色av一区二区三区蜜臀| 91一区在线观看| 欧美一区二区视频在线观看2020 | 久久精品久久久精品美女| 成人性生交大合| 欧美日韩小视频| 国产视频911| 五月天网站亚洲| 粉嫩av亚洲一区二区图片| 欧美日韩国产免费| 中文一区二区在线观看| 天堂蜜桃一区二区三区| 成人丝袜高跟foot| 91精品婷婷国产综合久久性色| 亚洲国产成人私人影院tom| 亚洲国产精品自拍| 成人夜色视频网站在线观看| 91麻豆精品久久久久蜜臀| 亚洲日本乱码在线观看| 九色|91porny| 欧美视频日韩视频在线观看| 中文av一区特黄| 麻豆国产精品一区二区三区| 91国产免费看| 日本一区二区三区视频视频| 另类中文字幕网| 欧美日韩在线播| 国产精品黄色在线观看| 国产又粗又猛又爽又黄91精品| 欧美三级中文字| 亚洲欧洲一区二区三区| 国产一区二区在线观看视频| 欧美日韩一卡二卡三卡| 亚洲特黄一级片| 国产精品系列在线观看| 日韩欧美aaaaaa| 首页综合国产亚洲丝袜| 色噜噜久久综合| 国产精品国产三级国产普通话99| 久久99国产精品免费网站| 欧美日韩成人高清| 亚洲国产欧美日韩另类综合| 成人18视频在线播放| 久久精品水蜜桃av综合天堂| 美女任你摸久久| 欧美精品在线一区二区| 亚洲第一主播视频| 欧美三级资源在线| 亚洲五月六月丁香激情| 欧美亚洲国产bt| 亚洲综合无码一区二区| 91网站在线播放| 国产精品家庭影院| jlzzjlzz欧美大全| 国产精品美女一区二区| 国产不卡视频在线播放| 久久久天堂av| 国产成人av福利| 国产日产欧美一区二区视频| 国内精品久久久久影院一蜜桃| 精品粉嫩aⅴ一区二区三区四区| 免费成人av在线| 日韩一级免费观看| 精品一区二区三区不卡| 欧美白人最猛性xxxxx69交| 蜜臀av性久久久久蜜臀aⅴ| 制服丝袜中文字幕一区| 日韩中文字幕区一区有砖一区 | 亚洲色图在线播放| 一本一道久久a久久精品综合蜜臀| 亚洲日本护士毛茸茸| 在线一区二区视频| 亚洲影视资源网| 欧美肥大bbwbbw高潮| 美女视频一区在线观看| 久久久久综合网| 成人aa视频在线观看| 一区二区三区欧美日韩| 在线观看www91| 天堂成人免费av电影一区| 欧美一区二区久久| 国产一区二区三区综合| 国产精品福利一区| 在线观看三级视频欧美| 日本中文在线一区| 精品国产一区二区三区久久久蜜月 | 国产一区二区伦理片| 中文一区二区在线观看 | 亚洲一二三四久久| 91精品国产综合久久精品性色| 免费人成在线不卡| 日本一区二区免费在线| 91女人视频在线观看| 亚洲动漫第一页| 精品国产三级电影在线观看| 成人精品视频一区二区三区| 一区二区三区欧美视频| 日韩欧美在线综合网| 成人黄色片在线观看| 亚洲小说春色综合另类电影| 精品三级av在线| jvid福利写真一区二区三区| 午夜电影网一区| 久久久久久97三级| 色婷婷精品久久二区二区蜜臂av| 男人的天堂亚洲一区| 中文字幕在线观看不卡| 欧美群妇大交群的观看方式| 韩国女主播成人在线观看| 亚洲人成人一区二区在线观看| 在线不卡的av| 成人黄色电影在线 | 91精品免费观看| 成人午夜av在线| 视频在线观看国产精品| 日本一二三不卡| 在线观看91av| www.性欧美| 美女脱光内衣内裤视频久久影院| 中文字幕一区二区5566日韩| 日韩一级在线观看| 色视频成人在线观看免| 国产麻豆成人精品| 亚洲成人777| 亚洲欧洲精品一区二区三区| 欧美一级一区二区| 色视频一区二区| 国产精品 欧美精品| 午夜亚洲福利老司机| 国产精品久久精品日日| 精品久久久久久久久久久久包黑料| 色妹子一区二区| 国产成人超碰人人澡人人澡| 日本不卡免费在线视频| 亚洲乱码国产乱码精品精可以看 | 精品影视av免费| 亚洲在线视频一区| 国产精品网站在线播放| 精品免费国产一区二区三区四区| 欧美色视频在线观看| 不卡视频一二三四| 国产一区二区三区香蕉| 日本vs亚洲vs韩国一区三区二区| 亚洲男女一区二区三区| 久久精品网站免费观看| 日韩精品中文字幕在线一区| 欧美体内she精高潮| 91一区一区三区| 成人动漫视频在线| 国产精品一区二区在线看| 日本不卡视频在线观看| 亚洲777理论| 亚洲线精品一区二区三区八戒| 国产亚洲一区二区三区四区| 精品免费99久久| 日韩欧美国产精品一区| 欧美高清性hdvideosex| 欧美性猛交xxxx黑人交| 色一情一乱一乱一91av| 91麻豆国产在线观看| av激情综合网| 成人免费观看视频| 国产91丝袜在线播放九色| 国产最新精品免费| 国产伦精品一区二区三区免费迷 | 精品88久久久久88久久久| 日韩女优视频免费观看| 日韩欧美在线123| 日韩一区二区在线播放| 欧美一级精品在线| 欧美一区二区三区视频在线观看| 欧美日韩黄色一区二区| 欧美老肥妇做.爰bbww视频| 欧美日韩国产综合一区二区三区| 欧美三级午夜理伦三级中视频| 欧美视频一二三区| 欧美精品一二三区| 欧美精品在欧美一区二区少妇| 在线播放日韩导航| 欧美一区二区三区免费在线看 | 美洲天堂一区二卡三卡四卡视频| 丝袜诱惑亚洲看片| 天堂va蜜桃一区二区三区 | 欧美成人免费网站| 精品av综合导航| 日本一区二区三级电影在线观看| 国产精品色呦呦|