以X-gen的Controller为例:

package $#modulePackge#.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import $#modulePackge#.service.I$#moduleNameSuperCase#Service;
import $#modulePackge#.vo.$#moduleNameSuperCase#Model;
import $#modulePackge#.vo.$#moduleNameSuperCase#QueryModel;
import com.sishuok.pageutil.Page;
import com.sishuok.util.format.DateFormatHelper;
import com.sishuok.util.json.JsonHelper; @Controller
@RequestMapping(value="/$#moduleName#")
public class $#moduleNameSuperCase#Controller {
@Autowired
private I$#moduleNameSuperCase#Service iservice = null; @RequestMapping(value="toAdd",method=RequestMethod.GET)
public String toAdd(){ return "$#moduleName#/add";
}
@RequestMapping(value="add",method=RequestMethod.POST)
public String add(@ModelAttribute("m") $#moduleNameSuperCase#Model m){
iservice.create(m);
return "$#moduleName#/success";
}
@RequestMapping(value="toUpdate/{uuid}",method=RequestMethod.GET)
public String toUpdate(Model model,@PathVariable("uuid") int uuid){
$#moduleNameSuperCase#Model m = iservice.getByUuid(uuid);
model.addAttribute("m", m);
return "$#moduleName#/update";
}
@RequestMapping(value="update",method=RequestMethod.POST)
public String post(@ModelAttribute("m") $#moduleNameSuperCase#Model m){
iservice.update(m);
return "$#moduleName#/success";
}
@RequestMapping(value="toDelete/{uuid}",method=RequestMethod.GET)
public String toDelete(Model model,@PathVariable("uuid") int uuid){
$#moduleNameSuperCase#Model m = iservice.getByUuid(uuid);
model.addAttribute("m", m);
return "$#moduleName#/delete";
}
@RequestMapping(value="delete",method=RequestMethod.POST)
public String post(@RequestParam("uuid") int uuid){
iservice.delete(uuid);
return "$#moduleName#/success";
}
@RequestMapping(value="toList",method=RequestMethod.GET)
public String toList(@ModelAttribute("wm")$#moduleNameSuperCase#WebModel wm,Model model){
$#moduleNameSuperCase#QueryModel qm = null;
if(wm.getQueryJsonStr()==null || wm.getQueryJsonStr().trim().length()==0){
qm = new $#moduleNameSuperCase#QueryModel();
}else{
String s = wm.getQueryJsonStr();
s = s.replace("-", "%");
qm = ($#moduleNameSuperCase#QueryModel)JsonHelper.str2Object(s, $#moduleNameSuperCase#QueryModel.class);
} qm.getPage().setNowPage(wm.getNowPage());
if(wm.getPageShow() > 0){
qm.getPage().setPageShow(wm.getPageShow());
} Page dbPage = iservice.getByConditionPage(qm); //
model.addAttribute("wm", wm);
model.addAttribute("page", dbPage); return "$#moduleName#/list";
}
@RequestMapping(value="toQuery",method=RequestMethod.GET)
public String toQuery(){
return "$#moduleName#/query";
}
}

  

最新文章

  1. Java进击C#——项目开发环境
  2. Mysql的一些常用方法
  3. AX函数,将EXCEL列号转为列名
  4. VM 启动时报错:Failed to lock the file
  5. poj2926 曼哈顿最远距离
  6. Oracle merge into 使用记录
  7. Java中循环删除list中元素的方法总结
  8. DELPHI编写服务程序总结
  9. ORACLE+PYTHON实战:复制A表数据到B表
  10. springboot情操陶冶-web配置(三)
  11. 在Mac 系统上使用MAMP搭建PHP开发环境
  12. Keepalived+LVS实现高可用负载均衡双主模式
  13. FZU - 1989 AntiAC
  14. WCF系列(六) - WCF安全系列(一) - basicHttpBinding
  15. 类中函数前、后、参数加const
  16. 图像_pytesseract
  17. RNA Sequencing
  18. float浮点数的四舍五入
  19. WPF样式——经典博客
  20. 【转】Base64算法详解

热门文章

  1. bzoj 1201[HNOI2005]数三角形 1202 [HNOI2005]狡猾的商人 暴力 权值并查集
  2. transition(动画属性)
  3. [04] css 选择器
  4. MVC 自定义HtmlHelper帮助类型之分页
  5. 报错!!!!!!!!!!!org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSessionRepositoryFilter' is defined
  6. bzoj4602 [Sdoi2016]齿轮
  7. 【洛谷 P2515】 [HAOI2010]软件安装 (缩点+树形背包)
  8. 【洛谷 P1653】 猴子 (并查集)
  9. 干货:MySQL数据库优化参考
  10. 教你从头到尾利用DQN自动玩flappy bird(全程命令提示,GPU+CPU版)【转】