使用Apache CXF 2.3的REST服务调用参数中的分号

我尝试在REST服务中传递包含分号(保留符号)的参数,但我遇到了Apache Tomcat的问题

REST服务使用Apache CXF 2.3编写

@GET
@Path("/getCmBuildAreas/{productName}/{projectName}/{buildConfiguration}")
@Produces(MediaType.APPLICATION_JSON)
public CmBuildAreas getCmBuildAreas(@PathParam("buildConfiguration") String buildConfiguration, @PathParam("productName") String productName, @PathParam("projectName") String projectName) {
...
}

然后我运行查询http://localhost:8080/DevManager/services/rest/getCmBuildAreas/QLARIUS/QLARIUS%3AMAINLINE_JAVA_STR/ANT_JAVA_BUILD%3B8并收到此错误:

Jul 18, 2011 1:57:53 PM org.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
WARNING: No operation matching request path /DevManager/services/rest/getCmBuildAreas/QLARIUS/QLARIUS%3AAMAINLINE_JAVA_STR/ANT_JAVA_BUILD%3B8 is found, HTTP Method : GET, ContentType : */*, Accept : image/jpeg,application/x-ms-application,image/gif,application/xaml+xml,image/pjpeg,application/x-ms-xbap,application/vnd.ms-excel,application/vnd.ms-powerpoint,application/msword,*/*,.
Jul 18, 2011 1:57:53 PM org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse
WARNING: WebApplicationException has been caught : no cause is available

PS:如果您需要任何其他信息,请询问 .

回答(1)

3 years ago

Apache CXF 2.3未处理正确编码分号的事实是由于该版本中的BUG . 它在版本2.4,2.3.4中得到修复 .