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dSizBpkijXgcOc3pAIQNSJExtrYZqnIb6Mh9urI47ODrVwE9RFOUbYICgCHdk6ebYmm9Xbr/vvPJ1dyYnZpbFqdlXU7OvMstiZll8uSxmcmJmuXz5m24bOtvNMOe5Js0rcvvvir4f7F5YKr9YEheWygvq1/LCUvnFUvnFUnlksIPoNO6JCJ2tEvI5DgePDZ3rCQV7QsGeIeBr6FxP6FzPcPBYy6FxwjCXWYTOVqj1KHSAeUWEzk40r4jQ2YnmFbmOTiIiXf8B34Pr8gVwL2UAAAAASUVORK5CYII=" alt="" />
public interface UserService {
public List<SysuserCustom> findSysuserCustom(SysuserQueryVo sysuserQueryVo)throws Exception ; }
前面在构建系统时已经整合好了项目结构。
这里花些笔墨再讲一下流程:
在url里面输入地址,然后根据Springmvc的配置,进入相应的Action。执行里面的函数,查询数据库把数据返回到页面上。
这里使用的是Springmvc的扫描功能注册里面得bean。
如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAx4AAACSCAIAAABEwotXAAAf3ElEQVR4nO2dv24bu7aHfR7g1Ocd8ghudB9i92oMv0MCGHKj3sCGkKTYrRvtU2XDraDETQwYu7IaF4mbIDtuLi52carDW4w0wxmSi4scjkaKvw9EIHE4i4v/Fn/mjJ0T4/Cf//zHzQQAAAB4sfyvmhP3ZqQVAAAAgA3SCgAAAKAYSCsAAACAYiCtAAAAAIqBtAIAAAAoBtIKAAAAoBhlpNX3//vvsaTJdNWnvHB7kmW7cOjz/quYTFdue3s2We9z6tCQBurDf/3zH//65z+GsCwYHNp+/7sOZ/W5mce4dg7B50PwYdDWyalnt+Qt4YJ9nt3AodNLl1aakagy60s/pbRym6+cmknSSjP1kwqT3FHQzyUhZUirjBiX9ENLT+NRs0o3hhgU/eoT7BzL6lB2S3TE3f7J22WPpd+ENn4PzOTv7XAqZ+b1jH5zVFreZwMHTS9OWnU6PRqe3EFSRl5NIBBKagJBwSrkIN7Jzwh5GQOUdImUNFGjqf+pVbSwGzH1U0j4mre/Kj0/hN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6wGe9sd5U7a03XD7wIC9Qr+RnCOu1+slyuXvdqluv9TQ24I9uXOo350J+Bo6sNueXvMMOAADHx6jSCsBsztFPAADwE4G0AgAAACgG0goAAACgGEgrAAAAgGIgrQAAAACKgbQCAAAAKAbSCgAAAKAYSCsAAACAYiCtAAAAAIqBtAIAAAAoBtIKAAAAoBhIKwAAAIBiIK0AAAAAioG0AgAAACgG0goAAACgGEgrAAAAgGIgrQAAAACKgbQCAAAAKAbSCgAAAKAYSCsAAACAYiCtAAAAAIqBtAIAAAAoBtIKAAAAoBhIKwAAAIBiIK0AAAAAioG0AgAAACgG0goAAACgGEgrAAAAgGIgrQAAAACKgbQCAAAAKAbSCgAAAKAYSCsAAACAYiCtAAAAAIqBtAIAAAAoBtIKAAAAoBhIKwAAAIBiIK0AAAAAioG0AgAAACjGy5JWk+kqqXA09TEuVCq44c0BAACAA+FlSStjaZr+Uimkgbz2hXtlndQp6c0BAACAA+HFSasaWe4YhYLxFohmKo0LJZFWAAAAB4teWv0/8f9aiuhZNAkAAAAASUVORK5CYII=" alt="" />
会把yycg.**.action包下面的给@Controller自动注册到bean容器中。
如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP0AAABDCAIAAADYl5SuAAAIK0lEQVR4nO2d32/TRhzA81/wWLFpUgUCrfwYYErVPwAJNClSkfaANsnamBDpBgRop3aBbmyMzVqnwgNr02nJhqg2CbQUxFAoEnR9QaLr1IpoLaGUtWkDoaWJYye9Pbi1z75zYueH0+S+H52q+np3PsTHl7N935wLAQB7uCrdAQCoAOA9wCLgPcAi4D3AIhXzvrVxQ6VOjRBCKCJwLj5U0S7gRATOxQmRSneDGZzzPuxrGDqzRU3d7jr8MOxrcKwnCCHwnnEK8X5lZSVvDsmQd3Mk3Dsz0j8z0v/w2oVeTwt+OOTdXEBPimA9eL8e+sAotr3v6+vzer2yLKs5six7vV6/35+7YvjEppmR/vSr2/FHwfGbl3o9Lfhh+MQm230vivXg3HroA6PY8z6TyXi93ubm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wgtbQfrd57cras5UDErQXY9R7ZeX5P3fi2xuNrSdbZXKUYmPYeWX5fS934trbja0lq6HUt895bhLrxbc3G15LUXMQteG8J2Pi2xqgd7yFBspVKKG6RQJwhwCLgPcAi4D3AIuA9wCLgPcAiFfO+tXFDpU6NEHL0RWhB+8sBZaVw7+2GyYZ9DUNntqip212HH4Z9DQX3pCDAe6b5H+s5spvc1wD+AAAAAElFTkSuQmCC" alt="" />
package yycg.base.action; import java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import yycg.base.pojo.vo.SysuserCustom;
import yycg.base.pojo.vo.SysuserQueryVo;
import yycg.base.process.result.DataGridResultInfo;
import yycg.base.service.UserService; /*
* 用户点击网页上的某个链接来到这里,然后执行这里的方法,从数据库中查到我想要的数据后返回到
*Model中,然后model里面的数据会传给显示的页面,当跳转到显示页面后,把model里面的数据显示出来
*完成任务。
*/
@Controller
//根访问目录
@RequestMapping("/user") public class UserAction { //@Autowired
private UserService userService; //子访问目录.用户查询页面
@RequestMapping("/queryuser")
public String queryUser(Model model)throws Exception{ return "/base/user/queryuser"; }
//用户查询页面的结果集
//最终DataGridResultInfo通过@ResponseBody将java对象转换成json对象。
//这里的形参包装类会一直从Action传到Service然后传到Mapper
@RequestMapping("/queryuser_result")
public @ResponseBody DataGridResultInfo queryUser_result(SysuserQueryVo sysuserQueryVo)throws Exception
{
//这些都是根据easyui的规则来的
DataGridResultInfo dataGridResultInfo=new DataGridResultInfo();
/*
* easyui规定这里还要填充total和rows
*/
List<SysuserCustom> rows=userService.findSysuserCustom(sysuserQueryVo);//把总的数据全部查出来
dataGridResultInfo.setRows(rows);
dataGridResultInfo.setTotal(rows.size());
return dataGridResultInfo; } }