小编exo*_*men的帖子

如何在Spring中将List对象上传到Model中?

所以,我在Controller中有以下方法:

@RequestMapping(value="/modules.htm",method = RequestMethod.GET )
protected String modules(ModelMap model) throws Exception {

      List<Module> modules = moduleService.getStudentModules(course_id);
      model.addAttribute....?
      return "modules";
}
Run Code Online (Sandbox Code Playgroud)

我需要在jsp View中显示这个列表,如:

<h1>Modules: </h1>
module 1 
module 2... etc
Run Code Online (Sandbox Code Playgroud)

我需要添加什么才能在JSP页面上显示完整列表?我应该如何将其上传到模型并检索它?先感谢您.

java model-view-controller spring jsp spring-mvc

3
推荐指数
1
解决办法
5982
查看次数

Javascript / regex:删除方括号之间的文本

是否可以更改此设置:

Hello, this is Mike [example]
Run Code Online (Sandbox Code Playgroud)

对此:

Hello, this is Mike
Run Code Online (Sandbox Code Playgroud)

使用JS + Regex?谢谢。

javascript regex

2
推荐指数
1
解决办法
6702
查看次数