微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

JBoss resteasy-jaxrs-3.12.1 undertow.core-2.1.3-HttpServletRequest为空

如何解决JBoss resteasy-jaxrs-3.12.1 undertow.core-2.1.3-HttpServletRequest为空

尊敬的JBoss RESTEasy专家-

我关注了

  1. Resteasy 3 @Context HttpServletRequest always null

  2. Obtain the request in Resteasy JAX-RS method

但是我总是使HttpServletRequest为空

具有a)org.jboss.resteasy.resteasy-jaxrs@3.12.1.Final b)io.undertow.core@2.1.3。最后 c)15丹麦克朗

这是我的代码段:

@Path("{p_uri}/login-actions")
public LActionsService getLActionsService(@Context HttpServletRequest rqst,final @PathParam("p_uri") String name) {
        
        
ResteasyProviderFactory.getInstance().injectProperties(service);
        
   
//Also tried 
rqst = ResteasyProviderFactory.getInstance().getContextData(HttpServletRequest.class);
      
if(rqst == null ) {
    System.out.println("parameter request is null"); 
        
    // do_somethingelse_with rqst
    
    return service;
}

错误转储:

RESTEASY003880: Unable to find contextual data of type: javax.servlet.http.HttpServletRequest 04:44:36,744 ERROR [stderr] (default task-5)     
    at org.jboss.resteasy.resteasy-jaxrs@3.12.1.Final//org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:77)

任何指针高度赞赏。谢谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。