从Web服务获取变量名称

时间:2014-10-05 21:28:36

标签: java web-services

我的网络服务有以下形式:

  @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);

0 个答案:

没有答案
相关问题