我已经google了很多,仍然感到困惑的是上面的每一个究竟是什么意思.
以下是我对它的理解:
我下载了每个jar并尝试反编译并查看其中的内容,但我只能在所有这些中找到接口而不是实现.
我在maven shade插件生成的重复警告的上下文中面临这些问题,并且需要正确理解上面的内容以找出要排除的内容和原因.
虽然帮助了别人,我注意到他们试图用做Spring开发@GET,@Consumes和@Path注释.据我所知,这些注释来自JSR-311规范.
我只是建议他们使用Spring @RequestMapping注释将端点映射到他们的控制器,但它让我对Spring MVC(任何版本)是否支持JSR 311感到好奇?
我有一个自定义上下文:
public class MyContext {
public String doSomething() {...}
}
Run Code Online (Sandbox Code Playgroud)
我创建了一个上下文解析器:
@Provider
public class MyContextResolver implements ContextResolver<MyContext> {
public MyContext getContext(Class<?> type) {
return new MyContext();
}
}
Run Code Online (Sandbox Code Playgroud)
现在在资源中我尝试注入它:
@Path("/")
public class MyResource {
@Context MyContext context;
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
SEVERE: Missing dependency for field: com.something.MyContext com.something.MyResource.context
Run Code Online (Sandbox Code Playgroud)
相同的代码在Apache Wink 1.1.3中运行良好,但在Jersey 1.10中失败.
任何想法将不胜感激.