我想通过@Requestparam
传递此选择,我有多个键名,但是我想一次传递一个键,所以,无论参数来自请求应提取的参数,我都只想使用一个字符串一个字符串中的键值
我不要这样@RequestParam(value = "pname", required = false) String pName, @RequestParam(value = "ssn", required = false) String sSN)
我想要这样的东西(即具有单个字符串变量的多个键值]
public List<Patient> getPatientListLike(@RequestParam(required = false) String searchString)
您可以在UI代码中将searchString创建为ssn = ssnValue(用户在屏幕上选择的ssnValue,并将其传递给url。
您可以使用HttpServletRequest请求获取查询字符串
public List<Patient> getPatientListLike(HttpServletRequest request) {
String searchString = request.getQueryString();
}