com.github.dactiv.showcase.web.account
类 ResourceController

java.lang.Object
  继承者 com.github.dactiv.showcase.web.account.ResourceController

@Controller
@RequestMapping(value="/account/resource")
public class ResourceController
extends Object

资源管理Controller

作者:
maurice

构造方法摘要
ResourceController()
           
 
方法摘要
 Resource bindingModel(String id)
          绑定实体数据,如果存在id时获取后从数据库获取记录,进入到相对的C后在将数据库获取的记录填充到相应的参数中
 String delete(List<String> ids, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
          通过主键id集合删除资源,删除成功后重定向到:account/resource/view
 void read(String id, org.springframework.ui.Model model, Resource entity)
          读取资源信息,返回account/resource/read.html页面
 String save(Resource entity, String parentId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
          保存或更新资源,保存成功后重定向到:account/resource/view
 List<Resource> view()
          获取资源列表,返回account/resource/view.html页面
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ResourceController

public ResourceController()
方法详细信息

view

@RequestMapping(value="view")
public List<Resource> view()
获取资源列表,返回account/resource/view.html页面

返回:
List

save

@RequestMapping(value="save")
public String save(@ModelAttribute(value="entity")
                                  Resource entity,
                                  String parentId,
                                  org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
保存或更新资源,保存成功后重定向到:account/resource/view

参数:
entity - 实体信息
parentId - 所对应的父类id
redirectAttributes - spring mvc 重定向属性
返回:
String

read

@RequestMapping(value="read")
public void read(String id,
                                org.springframework.ui.Model model,
                                @ModelAttribute(value="entity")
                                Resource entity)
读取资源信息,返回account/resource/read.html页面

参数:
id - 主键id
model - Spring mvc的Model接口,主要是将model的属性返回到页面中
entity - 实体信息

delete

@RequestMapping(value="delete")
public String delete(@RequestParam(value="ids")
                                    List<String> ids,
                                    org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
通过主键id集合删除资源,删除成功后重定向到:account/resource/view

参数:
ids - 主键id集合
redirectAttributes - spring mvc 重定向属性
返回:
String

bindingModel

@ModelAttribute(value="entity")
public Resource bindingModel(String id)
绑定实体数据,如果存在id时获取后从数据库获取记录,进入到相对的C后在将数据库获取的记录填充到相应的参数中

参数:
id - 主键ID


Copyright © 2014. All rights reserved.