rendering data in jsp using spring controllers and different classes

前端 未结 1 1619
忘了有多久
忘了有多久 2020-12-30 11:09

i want to render data

this is how my jsp page table look like \"

how i

1条回答
  •  长情又很酷
    2020-12-30 11:40

    Most likely your data is coming from database and this is kind of List of javabeans returned.

    Let's say this is:

    List objects
    

    You need to set it in controller level:

    @RequestMapping(value="/table")
    public ModelAndView renderTable() {
        ModelAndView mv = new ModelAndView("/table"); 
        mv.add("objects",objects);
        return mv;
    }
    

    Now this is the way you render it on the JSP:

    
        
                
    ${o.id} ${o.name} ${o.descriptio}

    You can read about it more here: http://static.springsource.org/spring/docs/3.0.1.RELEASE/reference/html/view.html

    0 讨论(0)
提交回复
热议问题