Java 我们应该如何使用@XMLRootElement配置响应对象而不使用out

Java 我们应该如何使用@XMLRootElement配置响应对象而不使用out,java,spring,jax-rs,cxf,aegis,Java,Spring,Jax Rs,Cxf,Aegis,我在这里使用CXF Aegis数据绑定生成Rest服务,我不想使用@XMLRootElement注释。为此,我使用@Path、@PathParam注释,但这里对于响应对象应该使用什么,我不清楚,请帮助解决这个问题 下面是rest服务配置的代码。这里不知道如何配置该列表 @POST @Path("/getworkorders/") @Consumes("application/json") @Produces("application/json") public Li

我在这里使用CXF Aegis数据绑定生成Rest服务,我不想使用@XMLRootElement注释。为此,我使用@Path、@PathParam注释,但这里对于响应对象应该使用什么,我不清楚,请帮助解决这个问题

下面是rest服务配置的代码。这里不知道如何配置该列表

   @POST
   @Path("/getworkorders/")
   @Consumes("application/json")
   @Produces("application/json")
   public List<WorkOrderNeutral>getWorkOrders(@PathParam("BaseFilterNeutral")BaseFilterNeutral baseFilterNeutral) throws ServiceException;
@POST
@路径(“/getworkorders/”)
@使用(“应用程序/json”)
@生成(“应用程序/json”)
公共ListgetWorkOrders(@PathParam(“BaseFilterNeutral”)BaseFilterNeutral BaseFilterNeutral)抛出ServiceException;
这是我的数据绑定提供程序

<bean id="jaxbProviderAegis-workOrder" class="org.apache.cxf.jaxrs.provider.aegis.AegisElementProvider"/> 


如果您使用Jackson作为JSON提供程序,您不需要使用
@XmlRootElement
。感谢您的回复,我得到的对象像[{“用户名”:“sathish”,“userId”:7},{“用户名”:“mani”,“userId”:101}],但我需要{objectName:[{“用户名”:“sathish”,“userId”:7},{“用户名”:“mani”,“userId”:101}]如果您使用Jackson作为JSON提供程序,您不需要使用
@XmlRootElement
。感谢您的回复,我得到的对象像[{“用户名”:“sathish”,“userId”:7},{“用户名”:“mani”,“userId”:101}],但我需要{objectName:[{“用户名”:“sathish”,“userId”:7},{“用户名”:“mani”,“userId”:101}]