如圖:
初學angular,這怎麼用?
public class StudentsAction implements RequestAware {
@Autowired
private StudentService studentService;
private Map<String, Object> request;
@Override
public void setRequest(Map<String, Object> map) {
this.request = map;
}
public String list() {
request.put("stu", studentService.getAllStudents());
return "list";
}
然後在ng-repeat中如何取得stu的值呢? ?
我這樣獲取不到呢
<tr ng-repeat="d in #request.stu | orderBy:predicate:reverse">
<td>{{d.id}}</td>
<td>{{d.name}}</td>
<td>{{d.age}}</td>
<td>{{d.address}}</td>
RequestAware
没用过,不过你的问题应该不在这,而在于structs2
中怎么返回json
資料給前端,看這兒吧