我正在将我所有的 Spring Services 转换为 Jersey,当我遇到一个关于如何将 Spring 的 RequestParam 的params功能转换为 Jersey 的问题时?
@RequestMapping(value = "/earnings", params = "type=csv" )
春天:
@RequestMapping(value = "/earnings", params = "type=csv")
public void earningsCSV() {}
@RequestMapping(value = "/earnings", params = "type=excel")
public void earningsExcel() {}
@RequestMapping("/earnings")
public void earningsSimple() {}
球衣:
@Path("/earnings")
public void earningsCSV() {}
@Path("/earnings")
public void earningsExcel() {}
@RequestMapping("/earnings")
public void earningsSimple() {}
如何在泽西岛指定类型“csv/excel”? Jersey 是否支持基于参数的过滤请求?
如果没有,有什么办法可以实现吗?我正在考虑一个过滤器来处理它们并重定向请求,但我有近 70 多个服务需要以这种方式解决。所以我最终必须为所有这些都写一个过滤器。此外,这听起来不像是一种干净的方法。
任何建议,将不胜感激。提前致谢。