小编Mai*_*lii的帖子

禁用 Spring boot websocket MessageBroker 日志的 INFO 级别日志记录

我有一个使用 SockJs 启用 Websocket 的 Spring Boot 应用程序。一切正常,但它一直在控制台中记录以下消息。

2017-09-19 11:04:48.164  INFO 8856 --- [MessageBroker-4] o.s.w.s.c.WebSocketMessageBrokerStats    : WebSocketSession[1 current WS(1)-HttpStream(0)-HttpPoll(0), 3 total, 0 closed abnormally (0 connect failure, 0 send limit, 0 transport error)], stompSubProtocol[processed CONNECT(3)-CONNECTED(3)-DISCONNECT(0)], stompBrokerRelay[null], inboundChannel[pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 45], outboundChannelpool size = 0, active threads = 0, queued tasks = 0, completed tasks = 22], sockJsScheduler[pool size = 4, active threads = 1, queued tasks = 2, …
Run Code Online (Sandbox Code Playgroud)

java logging sockjs spring-boot spring-websocket

5
推荐指数
1
解决办法
4164
查看次数

使用下拉列表过滤数据表列

我在根据下拉值过滤数据表记录时遇到问题。

例如,假设Garrett Winters一个用户连接到两个或多个办公室,例如Tokyo, San Francisco。如果我搜索Tokyo办公室,则Garrett Winters应该在该列表中,如果我搜索San Francisco办公室,则Garrett Winters应该再次出现在该列表中。

当前在下拉列表中生成了一个新选项Tokyo,San FranciscoGarrett Winters仅在搜索名称时不需要。

有人能帮忙吗?

$(document).ready(function() {
  $('#tableTrigger').DataTable({
    "lengthMenu": [
      [10, 25, 50, 100, -1],
      [10, 25, 50, 100, "All"]
    ],
    "scrollY": "200px",
    "dom": 'rtipS',
    // searching: false,
    "deferRender": true,
    initComplete: function() {
      var column = this.api().column(2);

      var select = $('<select class="filter"><option value=""></option></select>')
        .appendTo('#selectTriggerFilter')
        .on('change', function() {
          var val = $(this).val();
          column.search(val ? '^' + $(this).val() …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery datatables

5
推荐指数
1
解决办法
1万
查看次数

Spring Data,多个数据源,不是托管类型异常

我一直在尝试让多个数据库系统在同一个 Spring Boot 项目中工作的时间比应有的时间长。我不断遇到以下异常,需要更多的目光来推动我解决问题。

我对下面的代码量表示歉意,但是由于我不确定问题实际发生在哪里,所以我在下面列出了所有内容。

需要注意的是:我使用专有 ERP 数据库作为端点之一。该端点是 Oracle 数据库并且是只读的。如果需要,我们可以将其切换到 MySQL 端点,但是我的用例需要 ERP 的端点才能使项目成功。

使用的资源:

我确信我的答案可能仍然存在于上述之一中,但是我现在太接近问题了,这就是我需要帮助的地方。

例外:

java.lang.IllegalArgumentException: Not a managed type: class com.xxx.ddbo.suiteanalytics.objects.ReturnsReasonBrand
Run Code Online (Sandbox Code Playgroud)

代码:

application.properties

    #Global properties for spring configuration
    logging.level.org.apache=ERROR      
    logging.level.org.springframework=WARN
    logging.level.org.hibernate=INFO        
    logging.level.org.hibernate.type=INFO

    #Spring configuration
    spring.jpa.show-sql=true
    spring.jackson.property-naming-strategy=CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES
    spring.jpa.hibernate.naming.strategy=org.hibernate.cfg.ImprovedNamingStrategy
    spring.jpa.properties.hibernate.show_sql=false
    spring.jpa.properties.hibernate.use_sql_comments=true
    spring.jpa.properties.hibernate.format_sql=true
    spring.jpa.properties.hibernate.type=info
    spring.jpa.generate-ddl=false
    spring.jpa.database=default


    ## DATABASE CONFIGURATIONS

    #Properties for PostgreSQL connection
    spring.postgresql.datasource.url=xxxxxxxx
    spring.postgresql.datasource.username=xxxxxxxx
    spring.postgresql.datasource.password=xxxxxxxx
    spring.postgresql.datasource.driver-class-name=org.postgresql.Driver
    spring.postgresql.datasource.tomcat.max-active=50

    #Properties for NetSuite SuiteAnalytics ODBC connection
    #Sandbox URL
    spring.suiteanalytics.datasource.url=xxxxxxxx
    #Production URL
    #spring.suiteanalytics.datasource.url=xxxxxxxx
    spring.suiteanalytics.datasource.username=xxxxxxxx …
Run Code Online (Sandbox Code Playgroud)

java postgresql spring netsuite spring-boot

5
推荐指数
1
解决办法
4093
查看次数

JQuery - 只打开一个元素

我有这样的情况:

<div>
    <span id="x1"></span>
    <span id="x2"></span>
    <span id="x3"></span>
</div>
Run Code Online (Sandbox Code Playgroud)

而我正试图得到这样的东西:

<div>
    <span id="x1"></span>
</div>
<span id="x2"></span>
<div>
    <span id="x3"></span>
</div>
Run Code Online (Sandbox Code Playgroud)

我尝试使用这样的unwrap()函数来做到这一点:

$('#x2').unwrap();  
Run Code Online (Sandbox Code Playgroud)

但是这个功能删除了整个<div>.那我怎么能用jQuery/JavaScript呢?感谢帮助.

html javascript jquery

5
推荐指数
1
解决办法
411
查看次数

在 data-ajax-success 调用中以编程方式在 ValidationSummary 中添加错误

我成功地显示了一个ValidationSummary包含不jQuery显眼的验证器检测到的错误:

<form asp-controller="PlanningYearsEditModal" asp-action="EditPlanningYear" data-ajax="true" data-ajax-method="POST" data-ajax-success="onSuccess">
    <div id="content" class="modal-body">
        @Html.ValidationSummary(false, null, new { @class = "text-danger" })
        <table class="inner" style="width:100%" border=1>
            <tr class="azurbox rounded3 white bold">
                <td style="width:20%">@CommonResources.CommonField</td>
                <td style="width:80%">@CommonResources.CommonValue</td>
            </tr>
            <tr class="underline">
                <td>@Html.LabelFor(model => model.LabelFr)</td>
                <td>
                    @Html.EditorFor(model => model.LabelFr)
                    @Html.ValidationMessageFor(model => model.LabelFr, "*", new { @class = "text-danger" })
                </td>
            </tr>
            <tr class="underline">
                <td>@Html.LabelFor(model => model.LabelNl)</td>
                <td>
                    @Html.EditorFor(model => model.LabelNl)
                    @Html.ValidationMessageFor(model => model.LabelNl, "*", new { @class = "text-danger" })
                </td>
            </tr>
        </table>
    </div> …
Run Code Online (Sandbox Code Playgroud)

javascript c# ajax jquery asp.net-core-mvc

4
推荐指数
1
解决办法
2428
查看次数

更改日期时间选择器语言不起作用

我正在使用datetimepicker并且它工作正常,但我想将语言翻译为“pl”。但它不适用于以下任何选项:

$( ".input-group.date" ).datetimepicker({
    format: "dd MM yyyy - hh:ii",
    autoclose: true,
    locale: 'pl'

});

$( ".input-group.date" ).datetimepicker({
    format: "dd MM yyyy - hh:ii",
    autoclose: true,
    language: 'pl'
});

$( ".input-group.date" ).datetimepicker({
    format: "dd MM yyyy - hh:ii",
    autoclose: true,
    language: 'pl-PL'
});
Run Code Online (Sandbox Code Playgroud)

它总是出现在“en”中。你知道为什么不工作吗?

javascript jquery

4
推荐指数
1
解决办法
3640
查看次数

获取从 MVC 表中单击的行的 ID

我想Id在用户单击按钮时单击行。

我的代码如下。

   <table cellpadding="0" cellspacing="0" id="ProductGrid">
    <tr>
        <th>P Id</th>
        <th>P Name</th>
        <th>Price</th>
        <th></th>
    </tr>
    @foreach(Mvc4API.linqtosql.tblProduct prod in Model)
    {
        <tr>
            <td>@prod.Pid</td>
            <td>@prod.Pname</td>
            <td>@prod.Price</td>
            <td><button type="button" class="ids" id="btnpartial" value="showdetail" onclick="getview()"></button></td>
        </tr>
    }
</table>
Run Code Online (Sandbox Code Playgroud)

我试过:-

function getview() {
    debugger;
    var productId = $("#ProductGrid .ids").closest("tr").find("td").eq(0).html();
});
Run Code Online (Sandbox Code Playgroud)

但它不起作用。

javascript asp.net-mvc jquery

3
推荐指数
1
解决办法
6198
查看次数

$(element)[index].addClass(); 不起作用

我有多个具有相同类的元素。当我在下面使用此方法时,它不起作用。

$(".tab-content")[index].addClass("active-content");
Run Code Online (Sandbox Code Playgroud)

我的代码:

HTML:

<div class="container">
    <div class="content">
        <ul class="tag">
            <li>
                <a href="javascript:;">
                    Lodon
                </a>
            </li>
            <li>
                <a href="javascript:;">
                    Paris
                </a>
            </li>
            <li>
                <a href="javascript:;">
                    Tokyo
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <h3>Lodon</h3>
            <p>London is the capital of England</p>
        </div>
        <div class="tab-content">
            <h3>Paris</h3>
            <p>Paris is the capital of France</p>
        </div>
        <div class="tab-content">
            <h3>Tokyo</h3>
            <p>Tokyo is the capital of Japan</p>
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

和JS

$(".tag li").click(function () {
    var index = $(this).index();
    $(".tab-content")[index].addClass("active-content");
});
Run Code Online (Sandbox Code Playgroud)

https://codepen.io/WillyIsCoding/pen/KoMxMJ

javascript jquery

3
推荐指数
1
解决办法
5904
查看次数

如何在 Kendo 网格中没有事件的情况下知道哪一行处于编辑模式

在剑道网格中,我想知道编辑的哪一行。这是在网格中的网格更改被提交之前(因为我在这里进行验证)。在这里我遇到了一个问题,即调用了多个函数,因此我没有第一个函数中存在的事件。如下所示,我在数据中获取多行,我想从中知道哪一行已更新。我正在使用 Kendo 的内联模式。

function updateRow(event) {
    debugger
    $("#errorPaymentDue").hide();
    grid = $("#gridSupplierPaymentDue").data("kendoGrid");
    var index = $(event).closest("tr").index();
    ...
    myfunction1();
    //myfunctionN is call inside many function written inside myfunction1
}
function myfunctionN(){
      var gridValidation = $("#gridSupplierPaymentDue").data("kendoGrid");
      var data = gridValidation.dataSource.data();
      //want to know which row was edited without event
}
Run Code Online (Sandbox Code Playgroud)

我知道我可以将特定编辑行的索引从一个函数发送到另一个函数,但这将有多个函数更改,并且可能引用该函数的其他代码也可能需要更改。

javascript jquery kendo-ui kendo-asp.net-mvc

3
推荐指数
1
解决办法
2744
查看次数

手动触发时 Jquery 停止更改事件

change在“选择框”上绑定了一个事件,当用户手动更改选择框值时会调用该事件。但是当我们通过 javascript 触发更改事件时,我想停止更改事件调用$(element).trigger('change')。请帮忙

javascript jquery

2
推荐指数
2
解决办法
3476
查看次数