我升级我Wildfly 8.2.1.Final用的RESTEasy的新版本能够使用SNI支持(3.0.10不可用。最终版本)。所以,我在/wildfly /模块/系统/层/基目录复制resteasy-jboss-modules-3.0.23.Final内容。但现在我有不同的行为!我的Rest服务没有被调用。而当我检查了上下文/ servlet路径,我发现3.0.10.Final和3.0.23.Final版本之间不同的值:ServletPath变化3.0.23.Final
用的RESTEasy 3.0.10.Final我有以下值:
String contextPath = request.getContextPath(); // = "/myApp"
String servletPath = request.getServletPath(); // = "/api"
String pathInfo = request.getPathInfo(); // = "/auth"
而且具有的RESTEasy 3.0.23.Final我:
String contextPath = request.getContextPath(); // = "/myApp"
String servletPath = request.getServletPath(); // = "/api/auth"
String pathInfo = request.getPathInfo(); // = null
我的jboss-web.xml中:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/myApp</context-root>
</jboss-web>
而且我在web.xml中没有servlet映射。所有我必须是类延伸javax.ws.rs.core.Application与@ApplicationPath注释:
@ApplicationPath("/api")
public class RESTActivator extends Application {
private final Set<Class<?>> classes;
public RESTActivator() {
HashSet<Class<?>> c = new HashSet<>();
c.add(ARestService.class);
c.add(AnotherRestService.class);
classes = Collections.unmodifiableSet(c);
}
@Override
public Set<Class<?>> getClasses() {
return classes;
}
}
什么在web.xml的servlet映射是什么样子? –
@Steve C I已经更新了映射配置 – ElArbi