小编Luc*_*caA的帖子

从spring配置调用静态方法

是否可以在Spring配置文件中调用静态方法?

public MyClass {

   public static void staticMethod() {
       //do something
   }

}
Run Code Online (Sandbox Code Playgroud)
<bean id="myBean" class="MyClass">
   <!-- invoke here -->
</bean>
Run Code Online (Sandbox Code Playgroud)

java xml spring static

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

在JDBI/Dropwizard应用程序中使用@Transaction

我喜欢这两个jdbi dao:

public interface dao1 {
  @Query("insert into table1 ...")
  findByid(myBean1);
}

public interface dao2 {
  @Query("insert into table2 ...)
  save(myBean2;
  }
}
Run Code Online (Sandbox Code Playgroud)

我想在一个事务中执行两个dao的保存,如:

dao1.save();
dao2.save();
Run Code Online (Sandbox Code Playgroud)

使用spring我使用了@transactional注释.我可以用dropwizard和jdbi做什么?

java transactions jdbi dropwizard

10
推荐指数
1
解决办法
6297
查看次数

Swagger-api with dropwizard.io 0.9.1

我尝试使用dropwizard框架0.9.1配置swagger.

在我的pom.xml中:

<dependency>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-jersey2-jaxrs</artifactId>
    <version>1.5.4</version>
    <scope>compile</scope>
    <exclusions>
        <exclusion>
            <groupId>com.sun.jersey</groupId>
            <artifactId>*</artifactId>
        </exclusion>
    </exclusions>
</dependency>
Run Code Online (Sandbox Code Playgroud)

但是java.lang.NoClassDefFoundError: jersey/repackaged/com/google/common/collect/ImmutableMap抛出了.

怎么了?

解决方案是在依赖项部分中设置正确的排除项:

 <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-jersey2-jaxrs</artifactId>
        <version>1.5.4</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>org.glassfish.jersey.containers</groupId>
                <artifactId>jersey-container-servlet</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.glassfish.jersey.containers</groupId>
                <artifactId>jersey-container-servlet-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

java rest dropwizard swagger

5
推荐指数
0
解决办法
275
查看次数

可点击角材料卡

我想将路由器链接添加到席卡组件以使卡可点击。我的组件是这样的:

<mat-card class="card" >
     <mat-card-content>
          <mat-card-title> {{title}}</mat-card-title>
          <mat-card-subtitle> {{subtitle}} </mat-card-subtitle>
     </mat-card-content>
</mat-card>
Run Code Online (Sandbox Code Playgroud)

如何做到这一点?

谢谢。

typescript angular-material angular

0
推荐指数
3
解决办法
5388
查看次数