我的网络服务有以下形式:
@GET
@Path("/path")
@Produces(MediaType.APPLICATION_XML)
public makeSomethingXML(@NotNull @QueryParam("one") String one,
@QueryParam("two") String two,
@QueryParam("three") String three,
@Context SecurityContext context, @Context HttpHeaders headers, @Context HttpServletRequest request) throws SAXException, IOException, ParserConfigurationException {
return something;
}
如果我查看参数是否为null,我怎么能以异常方式抛出异常,说明变量的名称,如下所示
抛出nullException("必须引入" + one);