controller中拼接list

@Controller
@RequestMapping("paramter")
public class ParamterController {


    @Autowired
    private IParamterService service;




    @ResponseBody
    @RequestMapping(value = "findParamterByPid",method = RequestMethod.GET)
    public Map findParamterByPid(String pid){
        Map map = new HashMap<>();
        List paramterByPid = service.findParamterByPid(pid);
       StringBuffer stringBuffer=new StringBuffer();
             stringBuffer.append("");
        for (Paramter paramter: paramterByPid
             ) {
            stringBuffer.append("");
        }
        map.put("s2Str",stringBuffer.toString());
        map.put("s3Str",stringBuffer.toString());
        return map;
    }


    @RequestMapping(value = "tolist",method = RequestMethod.GET)
    public ModelAndView toList(String pid){
        ModelAndView modelAndView = new ModelAndView();
        List paramterByPid = service.findParamterByPid(pid);
        StringBuffer stringBuffer=new StringBuffer();
        //拼接第一个下拉菜单
        stringBuffer.append("");
        //拼接第二个下拉菜单
        stringBuffer.append("");
        //拼接第三个下拉菜单
        stringBuffer.append("");
       modelAndView.addObject("s1Str",stringBuffer.toString());
        modelAndView.setViewName("list");
        return modelAndView;
    }
}


你可能感兴趣的:(controller中拼接list)