小编Lug*_*aru的帖子

MongoDB:检查与DB的连接

我正在寻找检查Mongo DB连接的最佳方法.情况:客户端向服务器发出请求(api).服务器返回所有数据库的状态.

最好的办法是什么?

java mongodb

9
推荐指数
3
解决办法
3万
查看次数

Bootstrap:条纹div表

我正在使用Bootstrap css lib.我知道如何用这个lib制作条纹表,但如何制作条纹div?

例如:

<table id="newtable" class="table table-bordered table-striped fixedtable">
    <thead>
        <th>Date</th>
        <th>Info</th>
        <th>Price</th>
    </thead>
    <tbody>
        <tr>
            <td colspan="3">                
                <div>text 1</div> 
                <div>text 2</div>  
                <div>text 3</div>  
                <div>text 4</div>                                
            </td>
        </tr>
    </tbody>    
</table>    
Run Code Online (Sandbox Code Playgroud)

问题是:如何制作:<div>text 1</div>, <div>text 2</div>, <div>text 3</div>, <div>text 4</div>条纹?

html css twitter-bootstrap

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

Spring-boot 和 Gradle:构建时间太长 - 如何调试?

我有一个多部分项目,该项目的 API 部分有大约 10 个依赖项。

尝试使用 Spring Boot(bootRun) 运行 API 项目,一切正常,但构建时间太长。我已经尝试用 gradle 构建它paralleldaemon但它不起作用。

我如何调试构建过程以了解什么需要很长时间?

更新:

gradle build使用--debug进入此点并堆栈几分钟

13:53:54.215 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder$RootFactory] Loaded resolution results (0.003 secs) from Binary store in /private/var/folders/jg/94cgy2fs2mqckt3mx4fj52qm0000gn/T/gradle8000416708924643404.bin (exist: true)
> Building 0% > Resolving dependencies ':web-sb-api:runtime'
Run Code Online (Sandbox Code Playgroud)

在这里堆叠 2-3 分钟,然后继续进行很长的跟踪...

13:55:50.902 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction] Initial dependency graph:
13:55:50.902 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction] tv.accedo.appgrid:web-sb-api
13:55:50.903 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.newrelic.agent.java:newrelic-api
13:55:50.903 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.fasterxml.jackson.core:jackson-core
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.fasterxml.jackson.core:jackson-annotations
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.fasterxml.jackson.core:jackson-databind
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]         com.fasterxml.jackson.core:jackson-annotations
13:55:50.904 …
Run Code Online (Sandbox Code Playgroud)

java spring build gradle spring-boot

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

Spring boot:禁用安全自动配置

我有多部分网络项目。Web Admin部分包含:

compile('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-jetty")
compile("org.springframework.boot:spring-boot-starter-actuator")
Run Code Online (Sandbox Code Playgroud)

主项目构建文件包含:

compile group: 'org.springframework', name: "spring-webmvc", version: springVersion
compile(group: 'org.springframework.security', name: "spring-security-web", version: springSecurityVersion) { exclude(module: 'spring-jdbc') }
Run Code Online (Sandbox Code Playgroud)

Spring Boot 应用程序文件:

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
public class WebAdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(WebAdminApplication.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

但是当我对我的管理部分做 http 请求时,我在我的AuthenticationProvider

auth.getPrincipal() -> user
auth.getCredentials() -> caeebd3a-307b-4edf-8f2f-833fad9ebc00
Run Code Online (Sandbox Code Playgroud)

如何禁用自动安全功能?

java security spring-security web spring-boot

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

控制器和指令之间的AngularJS通信

如何从控制器获取一些数据并在指令中使用它没有问题.但是当我需要从指令中获取数据并在我的控制器中使用它时,我会堆叠这种情况.

例如:

我的控制器:

function MyController($scope, $location, myDirective) {
    "use strict";

    // here i need use scope.importantValue and create() method from directive

}
Run Code Online (Sandbox Code Playgroud)

我的指示:

        .directive("myDirective", function() {
"use strict";
return {
    restrict: 'A',
    template: '<div></div>',
    replace: true,
    scope: {
        data: '=',
    },
    link: function(scope, elm) {
        scope.importantValue = "value";

        function create() {
            console.log("Directive works...");
        }

};
})
Run Code Online (Sandbox Code Playgroud)

如何在控制器中使用指令中的变量或/和方法?

javascript web angularjs

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

Spring Boot:热插拔不起作用

我正在使用带有gradle插件的Spring Boot 1.3.2.在我的多部分项目中,HTML/JS/CSS文件的热交换/重新加载不起作用.

/resources
  |-wro.groovy
  |-application.yml
  |-/templates/(all *.html files and index.html)
  |-/static/
      |-/js/
      |-/css/
Run Code Online (Sandbox Code Playgroud)

application.yml

server:
 port: 8080

spring:
  thymeleaf:
    cache: false
    prefix: classpath:/templates/
    suffix: .html
    enabled: true
    encoding: UTF-8
    mode: HTML5
Run Code Online (Sandbox Code Playgroud)

在te projet中也使用了:wro4j,thymeleaf,AngularJS

部分gradle.build

buildscript {
    ext { springBootVersion = '1.3.2.RELEASE' }
    repositories {
        maven {
            url "https://ourartifactoryUrl/plugins-release"
            credentials {
                // artifactory log and pass
            }
        }
    }
    dependencies {
        classpath group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: springBootVersion
        classpath group: 'io.spring.gradle', name: 'dependency-management-plugin', version: '0.5.2.RELEASE'
        classpath group: 'org.jfrog.buildinfo', name: …
Run Code Online (Sandbox Code Playgroud)

java spring jetty gradle spring-boot

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

Gradle:使用Spring Boot的jvm参数进行自定义任务

尝试为Spring Boot创建一个小的自定义gradle任务,最初看起来像这样:

gradle bootRun --debug-jvm

任务应如下所示: gradle debugRun

我试过这个,但它不起作用:

task debugRun(dependsOn: 'bootRun') << {
    applicationDefaultJvmArgs = ['--debug-jvm']
}
Run Code Online (Sandbox Code Playgroud)

如何将此调试标志传递给bootRun任务?

jvm build gradle spring-boot

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