且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将响应标头添加到JAX-RS Webservice

更新时间:2023-02-16 23:10:55

您可以通过Web服务中的@Context注释注入对实际HttpServletResponse的引用,并使用addHeader()等添加标题。

You can inject a reference to the actual HttpServletResponse via the @Context annotation in your webservice and use addHeader() etc. to add your header.