posts - 241,  comments - 116,  trackbacks - 0
spring mvc3 REST中的一个注意点,比如:
@RequestMapping(value = "/addarticle/{name}", method = RequestMethod.POST)  
    public ModelAndView addArticleCategoriesForName(@PathVariable String name) {  
        List<Category> categories = new ArrayList<Category>();  
        Category category = new Category();  
        category.setName(name);  
Listview中使用线程实现无限加载更多项目的功能

        System.out.println(name);  
        categories.add(category);  
        ModelAndView mav = new ModelAndView("articleXmlView", BindingResult.MODEL_KEY_PREFIX + "category", categories);  
        return mav;  
    }  

  返回ModelAndView时,记得要用BindingResult.MODEL_KEY_PREFIX + 实体类的名,这个好象是个BUG还是不完善的地方,见:
http://forum.springsource.org/showthread.php?73221-Strange-bean-property-binding-result-in-Rest-Castor-result&p=271888#post271888
posted on 2011-07-25 09:24 墙头草 阅读(1728) 评论(1)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
人人游戏网 软件开发网 货运专家