在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ Java問答
尐潴豬 回答

if(arr[j]>arr[j+1]) 執(zhí)行這一步就直接跳去else了
所以完全沒計算就change = 0;
看你的題目描述應(yīng)該是用標(biāo)志位實現(xiàn)冒泡

        int length = arr.length;
        boolean flag = true;
        int temp = 0;
        while (flag) {
            flag = false;
            for (int j = 1; j < length; j++)
                if (arr[j - 1] > arr[j]) {
                    temp = arr[j - 1];
                    arr[j - 1] = arr[j];
                    arr[j] = temp;
                    flag = true;
                }
            length--;
        }
陌南塵 回答

我試了一下,你的配置在我這邊是沒有問題的對應(yīng)的url都可以請求到,post使用postman直接請求的,均可以請求到對應(yīng)的結(jié)果,我覺得你可是試著從其他地方找問題,shiro是沒有配置問題的。

不討囍 回答

spring mvc上傳文件的時候,你需要在spring mvc配置文件中配置org.springframework.web.multipart.commons.CommonsMultipartResolver文件上傳解析器。

1:當(dāng)一個請求過來的時候,會調(diào)用DispatcherServlet類中的doDispatch(HttpServletRequest, HttpServletResponse)方法。

doDispatch方法體

protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception {
        HttpServletRequest processedRequest = request;
        HandlerExecutionChain mappedHandler = null;
        boolean multipartRequestParsed = false;

        WebAsyncManager asyncManager = WebAsyncUtils.getAsyncManager(request);

        try {
            ModelAndView mv = null;
            Exception dispatchException = null;

            try {
                processedRequest = checkMultipart(request);
                multipartRequestParsed = processedRequest != request;

                // Determine handler for the current request.
                mappedHandler = getHandler(processedRequest, false);
                if (mappedHandler == null || mappedHandler.getHandler() == null) {
                    noHandlerFound(processedRequest, response);
                    return;
                }

                // Determine handler adapter for the current request.
                HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());

                // Process last-modified header, if supported by the handler.
                String method = request.getMethod();
                boolean isGet = "GET".equals(method);
                if (isGet || "HEAD".equals(method)) {
                    long lastModified = ha.getLastModified(request, mappedHandler.getHandler());
                    if (logger.isDebugEnabled()) {
                        String requestUri = urlPathHelper.getRequestUri(request);
                        logger.debug("Last-Modified value for [" + requestUri + "] is: " + lastModified);
                    }
                    if (new ServletWebRequest(request, response).checkNotModified(lastModified) && isGet) {
                        return;
                    }
                }

                if (!mappedHandler.applyPreHandle(processedRequest, response)) {
                    return;
                }

                try {
                    // Actually invoke the handler.
                    mv = ha.handle(processedRequest, response, mappedHandler.getHandler());
                }
                finally {
                    if (asyncManager.isConcurrentHandlingStarted()) {
                        return;
                    }
                }

                applyDefaultViewName(request, mv);
                mappedHandler.applyPostHandle(processedRequest, response, mv);
            }
            catch (Exception ex) {
                dispatchException = ex;
            }
            processDispatchResult(processedRequest, response, mappedHandler, mv, dispatchException);
        }
        catch (Exception ex) {
            triggerAfterCompletion(processedRequest, response, mappedHandler, ex);
        }
        catch (Error err) {
            triggerAfterCompletionWithError(processedRequest, response, mappedHandler, err);
        }
        finally {
            if (asyncManager.isConcurrentHandlingStarted()) {
                // Instead of postHandle and afterCompletion
                mappedHandler.applyAfterConcurrentHandlingStarted(processedRequest, response);
                return;
            }
            // Clean up any resources used by a multipart request.
            if (multipartRequestParsed) {
                cleanupMultipart(processedRequest);
            }
        }
    }

2:在doDispatch方法體中調(diào)用checkMultipart(request)方法判斷是否是文件上傳的請求,判斷是根據(jù)Content-type來的,如果是文件上傳的請求,在checkMultipart(request)方法中就會調(diào)用在CommonsMultipartResolver中的方法進(jìn)行文件解析(實際是調(diào)用apache commons-fileupload的文件長傳插件),解析完成后,其實文件已經(jīng)上傳到服務(wù)器本地磁盤了,請看下面的代碼片段。

protected HttpServletRequest checkMultipart(HttpServletRequest request) throws MultipartException {
        if (this.multipartResolver != null && this.multipartResolver.isMultipart(request)) {
            if (request instanceof MultipartHttpServletRequest) {
                logger.debug("Request is already a MultipartHttpServletRequest - if not in a forward, " +
                        "this typically results from an additional MultipartFilter in web.xml");
            }
            else {
                return this.multipartResolver.resolveMultipart(request);
            }
        }
        // If not returned before: return original request.
        return request;
    }

在checkMultipart方法體中調(diào)用了CommonsMultipartResolver類的resolveMultipart方法去解析文件,該方法返回的是MultipartHttpServletRequest對象,該對象中存有已經(jīng)上傳的服務(wù)器本地的文件對象。

3:獲取具體處理器的方法(mv = ha.handle(processedRequest, response, mappedHandler.getHandler()) 這行代碼)。
如果是文件上傳的話,processedRequest是上面的checkMultipart方法返回的對象。

實際調(diào)用的org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter類的handle方法,該方法中獲取實際被調(diào)用的方法參數(shù)上有哪些注解,然后根據(jù)注解的一些配置,從processedRequest獲取對應(yīng)的值。

比如你上面的testUpload()方法。在AnnotationMethodHandlerAdapter的handle()的方法中會獲取testUpload()的方法參數(shù)有@RequestParam這個注解,然后解析這個注解,從processedRequest請求中獲取到desc的值,獲取到名為file的文件,最后調(diào)用testUploaad()方法。具體是怎么解析的可以看看org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(Method, Object, NativeWebRequest, ExtendedModelMap)這個方法體。

朕略傻 回答

已經(jīng)解決了,原因是:CAS Server自帶的REST API,僅支持默認(rèn)UsernamePasswordCredential,我的項目中自定義擴展了UsernamePasswordCredential,所以需要在自定義驗證Handler中做個判斷,如果請求的Credential類型為org.apereo.cas.authentication.UsernamePasswordCredential, 就是REST請求來的,直接返回對應(yīng)的UsernamePasswordCredential對象即可。

小曖昧 回答

經(jīng)過1天的奮戰(zhàn),看了很多springboot項目,終于找到原因;
maven配置問題;

錯誤配置如下:

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>provided</scope>
            
        </dependency>

正確配置為

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>compile</scope>
        </dependency>

附上maven.scope的用法;
maven.scope的用法

獨白 回答

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

青檸 回答

如果是抽樣的話,那就可以用隨機數(shù)了吧。

  1. 每個數(shù)據(jù)設(shè)置唯一數(shù)字序號用于標(biāo)識
  2. 在范圍中生成10個不重復(fù)的隨機數(shù)
  3. 在ES查詢中使用es的引擎計算相關(guān)性(分?jǐn)?shù))
眼雜 回答

cgi了解一下,只要是可執(zhí)行程序都可以

舊酒館 回答

謝邀,從左邊開始
merge :就是git的合并代碼。遠(yuǎn)程代碼在你push之前已經(jīng)被修改了。就需要先merge。如果沒有沖突,就自動合并修改,否則需要逐一合并
rebase:拉下來的代碼有沖突,但是不會自動合并。需要你手動合并

第三個branch default我沒用過了

using stash:在更新前先清除stash
第二個沒用過。

心癌 回答

$re = '/"body":"([^"]+)".*"transTime":"([^"]+)"/';
$str = '{"returnCode":"0","resultCode":"0","sign":"19333CD7F9710A104DA5D815709697D2","outChannelNo":"2017120100401000000017","status":"02","mchId":"000000010000000002","channel":"wxPubQR","body":"收單支付","outTradeNo":"20171201150337579753","amount":0.01,"transTime":"20171201150337"}';
if (preg_match($re, $str, $matches)) {

echo $matches[1] . "\n";
echo $matches[2] . "\n";

}

念初 回答
[^【]+(?=】)|^[^【】]+$
熟稔 回答
$html = '<p>文章內(nèi)容
<img src="/images/nerong.jpg">
<img src="http://www.xxx.com/images/nerong.jpg">
<img src="/images/pic/nerong.jpg">
<img src="/file/pic/nerong.jpg">
文章測試內(nèi)容</p>';
$html = str_replace('src="/','src="http://www.xxx.com/',$html);
故人嘆 回答

首先是復(fù)雜度高的辦法

刪除的時候重新遍歷一下,把序號改過來

優(yōu)化方法

可以把序號和數(shù)據(jù)分開,刪除任意一條數(shù)據(jù)刪除最下面一個序號即可,這樣可以減少重新渲染的數(shù)量

扯不斷 回答

演示程序地址-三十客

$(document).ready(function () {
    var $texta = $('#my-textarea');
    var lastWidth = localStorage.getItem("my-area-width");
    var lastHeight = localStorage.getItem("my-area-height");
    if(lastWidth && lastHeight) {
        $texta.css("width",lastWidth+"px");
        $texta.css("height",lastHeight+"px");
    }
    $texta.data('x', $texta.outerWidth());
    $texta.data('y', $texta.outerHeight());
    $texta.mouseup(function () {
        var $this = $(this);
        var width = $this.outerWidth();
        var height = $this.outerHeight();
        if (width != $this.data('x') || height != $this.data('y')) {
            alert(width + ' - ' + $this.data('x') + '\n' + height + ' - ' + $this.data('y'));
            localStorage.setItem("my-area-width",width);
            localStorage.setItem("my-area-height",height);
        }
        $this.data('x', width);
        $this.data('y', height);
    });
});
冷眸 回答

ArrayAdapter requires the resource ID to be a TextView,你請求的是adapter用的資源id應(yīng)該是一個textView控件的id。根據(jù)你寫的adapter繼承的ArrayAdapter的的構(gòu)造函數(shù)看,他需要傳的是一個textview控件的資源id而不是一個布局的資源id

念舊 回答

可以采用在訪問方法時就對參數(shù)進(jìn)行校驗,采用自定義注解的形式,通過自定義注解的相應(yīng)的aop去寫邏輯進(jìn)行校驗。

久不遇 回答

上傳文件你可以分塊啊 用plupload 前端控制進(jìn)度 下次打開頁面可以重新繼續(xù)上傳

挽青絲 回答

你知道web-inf目錄的作用嗎?只能有服務(wù)器來訪問,瀏覽器是無法訪問的,所以你直接訪問web-inf目錄下的東西就會報404