Tag: dropwizard

你如何设置Kotlin,Gradle和Web框架的Spring Loaded?

我是JVM的新手,有兴趣尝试Kotlin进行REST风格的Web开发。 热重新加载是我习惯于从Python,Ruby和JavaScript等动态脚本语言开发的function。 玩,Dropwizard和Spring Boot都显得有吸引力。 我会愿意使用上述任何一种,但是我一直无法得到一个简单的“保存文件,重新加载网页”的工作流与任何上述设置。 这怎么能做到呢?

Kotlin / Dropwizard中的子资源定位器

我正在尝试使用Kotlin 1.0.3在Dropwizard 1.0中使用子资源来实现资源。 我有一个示例资源: package net.reznik.stackoverflow.resources import javax.ws.rs.Consumes import javax.ws.rs.Path import javax.ws.rs.PathParam import javax.ws.rs.Produces import javax.ws.rs.core.MediaType @Path(“/test”) @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) class TestResource { @Path(“/{foo}/”) fun subresource(@PathParam(“foo”) foo: String): Any { return TestSubResource() } } 和一个子资源: package net.reznik.stackoverflow.resources import javax.ws.rs.POST import javax.ws.rs.Path import javax.ws.rs.core.MediaType import javax.ws.rs.core.Response class TestSubResource { @POST @Path(“/bar”) fun bar(request: String): Response { return […]

Dropwizard管理员安全

有没有办法给管理servlet添加登录安全? 好像在V0.7中,您可以将以下两个添加到您的yaml文件中: adminUsername: user1234 adminPassword: pass5678 然而,我试过在最新版本(0.9.2),它给了我一个错误说:server.yaml有一个错误: * Unrecognized field at: server.adminConnectors.[0].adminUsername Did you mean?: – soLingerTime – bindHost – idleTimeout – useServerHeader – useDateHeader [14 more] 这是我的: adminConnectors: – type: http port: 9180 adminUsername: user1234 adminPassword: pass5678

你如何设置Kotlin,Gradle和Web框架的Spring Loaded?

我是JVM新手,有兴趣尝试使用Kotlin进行REST风格的Web开发。 热重新加载是我习惯于从Python,Ruby和JavaScript等动态脚本语言开发的功能。 玩,Dropwizard和Spring Boot都显得有吸引力。 我会愿意使用上述任何一种,但是我一直无法得到一个简单的“保存文件,重新加载网页”的工作流与任何上述设置。 这怎么能做到呢?

在Kotlin中实现Java注释

我正在Kotlin中实现dropwizard示例应用程序,并且有一个实现DateRequiredFeature的问题。 Java代码如下: @Provider public class DateRequiredFeature implements DynamicFeature { @Override public void configure(ResourceInfo resourceInfo, FeatureContext context) { if (resourceInfo.getResourceMethod().getAnnotation(DateRequired.class) != null) { context.register(DateNotSpecifiedFilter.class); } } } 与注释定义为: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface DateRequired {} 对于Kotlin方面我有以下特点: @Provider class DateRequiredFeature : DynamicFeature(){ override fun configure(resourceInfo: ResourceInfo, context: FeatureContext) { if (resourceInfo.resourceMethod.getAnnotation(DateRequired::class.java) != null) { context.register(DateNotSpecifiedFilter::class.java) } } } […]