【发布时间】:2016-02-26 10:50:01
【问题描述】:
我正在将我所有的 Spring 服务转换为 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() {}
如何在 Jersey 中指定类型“csv/excel”? Jersey 是否支持基于参数的过滤请求?
如果没有,有什么方法可以实现吗? 我正在考虑一个过滤器来处理它们并重定向请求,但我有近 70 多个服务需要以这种方式解决。 所以我最终必须为所有这些都写一个过滤器。此外,这听起来不像是一种干净的方法。
任何建议将不胜感激。 提前致谢。
【问题讨论】:
标签: spring spring-mvc jersey jersey-2.0 request-mapping