отдых-сервер.xml:
<jaxrs:server id="baseApi" address="http://localhost:8080/myfashions/catalog">
<jaxrs:serviceBeans>
<bean class="com.myfashions.api.service.rest.implementation.CatalogServiceImpl"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="customRequestHandler"/>
<ref bean="customResponseHandler"/>
<ref bean="restExceptionMapper"/>
<bean class="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider"/>
</jaxrs:providers>
</jaxrs:server>
Интерфейс:
public interface CatalogService {
@Path("/categories")
@GET
@Produces({MediaType.APPLICATION_JSON})
SelectCategoryBeanList getMyfashionCategories();
}
Класс:
@Service
@Path("/myfashions/catalog")
public class CatalogServiceImpl implements CatalogService {
@Override
public SelectCategoryBeanList getMyfashionCategories() {
...
...
}
}
Когда я позвонил http://localhost:8080/myfashions/catalog/categories
, я получил Не найден путь запроса, соответствующий корневому ресурсу /myfashions/catalog/categories
, Относительный путь: исключение /categories
. Может ли кто-нибудь помочь мне в этом.
@Produces
. Он является наследственным. - person Donal Fellows   schedule 23.09.2013@Path
сCatalogServiceImpl
наCatalogService
? - person bdkosher   schedule 19.09.2014