RESTEasy - @Path requiring a full path?

前端 未结 2 1273
无人及你
无人及你 2020-12-09 17:17

I was messing around with JAX-RS and made an application which calls REST services which produce JSON. I tried Jersey and everything went fine, but I had to switch to RESTEa

相关标签:
2条回答
  • 2020-12-09 17:34

    Solution: add the following in your web.xml

    <context-param>
        <param-name>resteasy.servlet.mapping.prefix</param-name>
        <param-value>/rest</param-value>
    </context-param>
    

    Where /rest is the beginning of your <url-pattern>/rest/*</url-pattern>

    (Source: http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html/Installation_Configuration.html#d0e72)

    0 讨论(0)
  • 2020-12-09 17:38

    On JBoss AS 7.1 I also had to add to add resteasy.resources ... which is further explained here http://www.javaroots.com/2013/05/creating-rest-services-with-rest-easy.html You may get error like this : Could not find resource for relative : /application/test of full path:... You have to define resteasy.resource context param with the full path of Rest class.

    0 讨论(0)
提交回复
热议问题