解决方案 »

  1.   

    话说不是直接return那个model嘛?
    貌似spring有段时间没用记不清了
    好像是这样的~
      

  2.   

    之所以拿不到值,是因为没有返回值
    代码改成如下就行了
    Controller: @Controller
    public class TestController {
    @RequestMapping(value = "test", method = RequestMethod.GET)
    public String test(Model model) {
    return new ModelAndView("/test", "s", "String");;
    }
    }
    View:<body>
     ${s }
    </body>
    建议看一下Spring MVC返回值的方法:
    http://blog.csdn.net/hankaibo/article/details/7239442
    http://my.oschina.net/bosscheng/blog/126941#OSC_h2_8
      

  3.   


    public String test(ModelMap model) {
    model.put("s", "String");
    return "test";
    }