package action; import java.util.List; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.struts2.json.annotations.JSON; import model.Users; import com.opensymphony.xwork2.ActionSupport; import dao.BaseDao; public class UsersAction extends ActionSupport { Users users; BaseDao baseDao; List<Users> userList; private JSONArray rows; private String result; private int total = 0; public JSONArray getRows() { return rows; } public void setRows(JSONArray rows) { this.rows = rows; } public String getResult() { return result; } public void setResult(String result) { this.result = result; } public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } @JSON(serialize = false) public List<Users> getUserList() { return userList; } @JSON(serialize = false) public void setUserList(List<Users> userList) { this.userList = userList; } @JSON(serialize = false) public Users getUsers() { return users; } @JSON(serialize = false) public void setUsers(Users users) { this.users = users; } @JSON(serialize = false) public BaseDao getBaseDao() { return baseDao; } @JSON(serialize = false) public void setBaseDao(BaseDao baseDao) { this.baseDao = baseDao; } @SuppressWarnings("unchecked") public String login() { if (this.users == null) { return LOGIN; } if (baseDao.loginByExample(users) == null) { return LOGIN; } return SUCCESS; } @SuppressWarnings("unchecked") public String getAllUser() { System.out.println("-----------------正在查询所有用户-----------------"); userList = baseDao.queryByHql("from Users"); this.setRows(JSONArray.fromObject(userList)); this.setTotal(userList.size()); System.out.println(("[total]:" + total + "[rows]:" + rows)); return "root"; } }

微信网友_6374390005878784 LV1
2023年3月4日
and123456 LV11
2022年5月7日
waterlq LV1
2021年3月27日
Dream shadow LV9
2020年12月15日
李兰香 LV11
2019年12月28日
jeep123456 LV10
2019年7月5日
wxy123 LV2
2019年6月18日
傻傻的琪默 LV2
2019年5月8日
TMingMin LV10
2019年3月9日
ws760823 LV8
2019年3月8日

y_x_happy LV4
2024年6月25日
3334004690 LV11
2024年5月27日
Gin19960217 LV4
2024年1月5日
uni-code_0123 LV1
2023年12月7日
月光skr LV4
2023年3月2日
wujiahua LV3
2022年12月13日
cc900118 LV17
2022年11月21日
gxlgxl LV4
2022年5月30日
and123456 LV11
2022年5月7日
NHealers LV5
2022年4月3日