Tomcat 7.0
无法启动以下方法定义
@GET
@Path("/GetSeriesByIndex")
@Produces("application/json")
public String getSeriesListByIndex(@QueryParam("indexCharacter")char indexCharacter){
String allSeriesByIndex = null;
ArrayList<SeriesListDTO> seriesListing=null;
try{
ProjectManager projectManager = new ProjectManager();
seriesListing = projectManager.getSeriesListByIndex(indexCharacter);
Gson gson = new Gson();
allSeriesByIndex = gson.toJson(seriesListing);
}catch(Exception e){
System.out.println(e);
}
return allSeriesByIndex;
}
带有错误消息
com.sun.jersey.api.container.ContainerException: Method, public java.lang.String tv.series.services.webService.TV_Services.getSeriesListByIndex(char), annotated with GET of resource, class tv.series.services.webService.TV_Services, is not recognized as valid Java method annotated with @HttpMethod.
更改 to 的类型后indexCharacter
,String
系统启动并且一切正常。
有人可以解释为什么会这样吗?
我正在使用jersey 1.0.3
库。也许这是该版本中的一些错误?
谢谢