实际上我会从@ManagedService 路径中检索两个参数,但我只得到空值。代码类似于:
...
import org.atmosphere.config.service.PathParam;
import org.atmosphere.config.service.ManagedService;
import org.atmosphere.config.service.Singleton;
@Singleton
@ManagedService(path = "/chat/{myId}/{destId}")
public class Chat {
@PathParam("myId")
private String mittId;
@PathParam("destId")
private String destId;
@Ready
public void onReady(AtmosphereResource r) {
logger.info("User {} want to chat with {}", mittId,destId);
}
调试“mittId”和“destId”为空。代码有错误或我忘记了什么?实际上我使用的是 Atmosphere-runtime 2.3.0。
感谢任何会提供帮助的人!