是否可以在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) 我喜欢这两个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做什么?
我尝试使用dropwizard框架0.9.1配置swagger.
在我的pom.xml中:
Run Code Online (Sandbox Code Playgroud)<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>
但是
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) 我想将路由器链接添加到席卡组件以使卡可点击。我的组件是这样的:
<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)
如何做到这一点?
谢谢。
java ×3
dropwizard ×2
angular ×1
jdbi ×1
rest ×1
spring ×1
static ×1
swagger ×1
transactions ×1
typescript ×1
xml ×1