【发布时间】:2014-04-15 16:13:51
【问题描述】:
如何通过 Spring Boot 配置 JAX-RS 资源以在嵌入式 tomcat 容器中可用?
以下是我拥有的 JAX-RS 资源(Groovy):
@Component
@Path('files')
@CompileStatic
class MyResource {
@Autowired
FileRepository repository
@GET
@Path('{id}')
@Produces(value = MediaType.APPLICATION_JSON)
Response getFileDetails(@PathParam("id") String id) {
println "getFileDetails called with $id"
return Response.ok().build()
}
}
当我尝试使用 localhost:8080/files/123 进行 http GET 时,我收到 404 错误。我错过了什么? 我在 tomcat 启动期间没有看到错误。
【问题讨论】:
标签: jax-rs spring-boot