【发布时间】:2011-04-06 05:47:19
【问题描述】:
我可以使用 SSR(结构搜索和替换)轻松找到我的项目中提到的某些注释。例如,我有以下基于弹簧的代码:
class DashboardController {
@RequestMapping("/dashboard")
public void doDashboard() {
[...]
}
}
如果我按模式org.springframework.web.bind.annotation.RequestMapping 搜索,我会找到我的代码。但是,如果我想找到带有参数化注解的方法,那么只找到带有注解 @RequestMapping 的“/dashboard” url 的方法呢?
我可以简单地通过@RequestMapping("/dashboard")字符串搜索,但是注解可以有几种写法:
@RequestMapping("/dashboard")
@RequestMapping(value = "/dashboard", method = {RequestMethod.POST})
@RequestMapping(headers = "content-type=application/*", value = "/dashboard")
等等
【问题讨论】:
标签: java annotations intellij-idea structural-search