【问题标题】:search data from bean using JAX-RS Search issue使用 JAX-RS 搜索问题从 bean 中搜索数据
【发布时间】:2014-07-12 10:29:29
【问题描述】:
import java.util.List;    
import javax.ws.rs.GET;    
import javax.ws.rs.Path;    
import javax.ws.rs.core.Context;    
import org.apache.cxf.jaxrs.ext.search.SearchCondition;    
import org.apache.cxf.jaxrs.ext.search.SearchContext;    
import com.f2s.bean.Recentbean;

 @Path("search") 
   public class SearchResource {
      private List<Recentbean> ra;

    @Path("book")
    @GET
    public List<Recentbean> findBooks(@Context SearchContext searchContext) 
 {
     SearchCondition<Recentbean> condition = searchContext.getCondition(Recentbean.class);                 
    return condition.findAll(ra);
 }

错误:- 使用 GET 注释的资源类 com.f2s.restws.SearchResource,未被识别为有效的资源方法。

com.sun.jersey.spi.inject.Errors$ErrorMessagesException

【问题讨论】:

    标签: java rest


    【解决方案1】:

    首先,你的“问题”其实不是问题。你只是提出了一个你得到的错误。没有解释,没有预期的行为,没有问任何问题。提供更多详细信息会有所帮助。

    其次,您是否看过处理所提出异常的其他问题?这里有几个:

    Exception :com.sun.jersey.spi.inject.Errors$ErrorMessagesException

    Jersey: com.sun.jersey.spi.inject.Errors$ErrorMessagesException

    Errors$ErrorMessagesException when using Jersey in Java

    由于我的声誉,我无法将其添加为评论...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多