主界面效果图
类别
index.jsp
<div class="col-sm-3 l-content">
<ul class="list-group c-category ">
</ul>
</div>
CategoryDao
public List<Category> list(Category category, PageBean pageBean) throws Exception {
String sql = "select * from t_easyui_category where true ";
return super.executeQuery(sql,Category.class,pageBean);
}
CategoryAction
private CategoryDao categoryDao = new CategoryDao();
private Category category = new Category();
@Override
public Category getModel() {
return category;
}
public String combobox(HttpServletRequest req,HttpServletResponse resp) {
try {
List<Category> list = this.categoryDao.list(null, null);
ResponseUtil.writeJson(resp, list);
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
index.js(使用ajax,通过在后台与服务器进行少量数据交换,可以使网页实现异步更新。)