1
我有一个项目设置与春季启动和泽西岛,我需要服务静态内容。与其他类似问题的主要区别在于“mywebsite.com/”必须是Jersey资源。这是我目前JerseyConfig:Spring Boot泽西静态内容与资源在“/”
@ApplicationPath("/")
@Configuration
public class JerseyConfig extends ResourceConfig {
public JerseyConfig() {
packages("com.mywebsite.services.rest",
"com.mywebsite.services.publication");
property(ServletProperties.FILTER_FORWARD_ON_404, true);
}
}
我的出版资源:
@Component
@Path("/")
@Produces(MediaType.TEXT_HTML)
public class PublicacionResource {
@GET
public Template index() throws Throwable {
return generateTemplateWithParameters("instalaciones", null, null);
}
...
}
新泽西似乎并没有被转发404个请求,因为我无法访问静态内容。
是否配置泽西岛作为一个过滤器运行? –
是的,我设置了'spring.jersey.type = filter' –
_“与其他类似问题的主要区别在于”mywebsite.com/“必须是Jersey资源。”_ - 这是否意味着如果没有'/'资源,它的工作原理? –