- 浏览: 700361 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (362)
- java基础 (33)
- html/css+div/javascript (17)
- Ajax/XML/JSON/XSL (7)
- JQuery (11)
- Extjs (1)
- JSP/Servlet (19)
- MVC模式 (4)
- struts 1 (17)
- Struts 2.3.4 (17)
- Spring 3.2 (26)
- Springmvc (3)
- Hibernate 4.1 (21)
- ibatis (6)
- Velocity模板语言 (2)
- Rose框架 (5)
- EJB (1)
- JUnit测试 (2)
- 数据库DB (24)
- 重构 / 设计模式 (3)
- 开发工具IDE (37)
- 数据结构与算法设计 (3)
- Android (12)
- Linux (4)
- bug集合 (29)
- 缓存技术(redis) (3)
- Lucene全文索引 (15)
- maven3.0.5 (4)
- 小工具集合 (18)
- 面试题 (5)
- 闲聊 (11)
- 其他 (4)
- 接口API (2)
- work (2)
- Flex (0)
- JMS (1)
- 开源项目集合 (1)
- 技术博客 (1)
- 分类04 (0)
- 分类05555 (0)
最新评论
-
小小小羊:
好屌...
java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$Refle -
liubinli2005:
这个可以脱底spring。单独使用吗?
DAO层:jade -
cangbaotu:
我觉得对于开发者来说,能脚本化编写爬虫是一件挺开心的事情( ̄▽ ...
网页爬取 -
asjava:
很好的文章, 但每段代码清单都重复了一次.
spring 事务 -
xia635317478:
jethypc 写道验证码的session无法传过去啊 还是我 ...
登陆验证码(struts2实现)
数据分页显示(SSH实现+Ajax读取json)
1.bean类:pageInfo.java
package com.org.momo.bean; public class PageInfo { private Integer pageRows ; //每页行数 private Integer currentPage ; //当前页数 private Integer pageTotal ; //页面总数 public Integer getPageRows() { return pageRows; } public void setPageRows(Integer pageRows) { this.pageRows = pageRows; } public Integer getCurrentPage() { return currentPage; } public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; } public Integer getPageTotal() { return pageTotal; } public void setPageTotal(Integer pageTotal) { this.pageTotal = pageTotal; } }
2.dao接口:
package com.org.momo.dao; import java.util.List; import com.org.momo.bean.PageInfo; import com.org.momo.bean.Team; public interface TeamDao { public void insert(Team team) throws Exception ; public void deleteById(Integer id) throws Exception ; public Team findById(Integer id) throws Exception ; public List<Team> findAll() throws Exception ; public void update(Team team) throws Exception ; public List<Team> findAllPage(PageInfo pageInfo) throws Exception ; }
3.dao接口实现类,有两种实现底层数据查询:
a.Hibernate自身实现
b.spring对Hibernate的支持HibernateTemplate实现
a.Hibernate自身实现:
package com.org.momo.dao.hibernateTemplate; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import com.org.momo.bean.PageInfo; import com.org.momo.bean.Team; import com.org.momo.dao.TeamDao; import com.org.momo.util.HibernateUtil; /** * 此方法为Hibernate自身的类实现底层数据访问 * 另外一种实现方式就是:spring对Hibernate的支持HibernateTemplate(见下一个 * 类 TeamDaoHibernateTemplate.java * ) * */ public class TeamDaoHibernate implements TeamDao { private SessionFactory sessionFactory; public TeamDaoHibernate() { sessionFactory = HibernateUtil.getSessionFactory(); } public void insert(Team team) throws Exception { Session session = sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); session.save(team); transaction.commit(); session.close() ; } public void deleteById(Integer id) throws Exception { Session session = sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); String hql = "delete from Team where id=?"; Query query = session.createQuery(hql); query.setInteger(0, id); query.executeUpdate(); transaction.commit(); session.close(); } public void update(Team team) throws Exception { Session session = sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); session.merge(team); transaction.commit(); session.close(); } public List<Team> findAll() throws Exception { List<Team> teams = null; Session session = sessionFactory.openSession(); Query query = session.createQuery("from Team"); teams = query.list(); session.close(); return teams; } public Team findById(Integer id) throws Exception { Team team = null; Session session = sessionFactory.openSession(); Query query = session.createQuery("from Team where id=?"); query.setInteger(0, id); team = (Team)query.uniqueResult(); session.close(); return team; } public List<Team> findAllPage(PageInfo pageInfo) throws Exception { List<Team> teams = null; Session session = sessionFactory.openSession(); Query queryTotal = session.createQuery("select count(id) from Team"); int rowCount = ((Long)queryTotal.uniqueResult()).intValue() ; //先转换为Long 在转换为int int pageTotal = rowCount/pageInfo.getPageRows(); if(rowCount%pageInfo.getPageRows() > 0) { pageTotal++; } pageInfo.setPageTotal(pageTotal); Query query = session.createQuery("from Team"); query.setFirstResult(pageInfo.getPageRows()*(pageInfo.getCurrentPage()-1)); query.setMaxResults(pageInfo.getPageRows()); teams = query.list(); session.close(); return teams; } }
package com.org.momo.util; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfiguration; public class HibernateUtil { private static final SessionFactory sessionFactory; static{ try{ //初始化hibernate.cfg.xml配置,建立数据库连接 sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory(); }catch(Exception e){ e.printStackTrace() ; throw new ExceptionInInitializerError(e) ; } } public static SessionFactory getSessionFactory(){ return sessionFactory ; } } [color=brown]applicationContext.xml文件配置映射: <bean id="teamDao" class="com.org.momo.dao.hibernateTemplate.TeamDaoHibernate"></bean>[/color]
b.spring对Hibernate的支持HibernateTemplate实现:
package com.org.momo.dao.hibernateTemplate; import java.sql.SQLException; import java.util.List; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session; import org.springframework.orm.hibernate3.HibernateCallback; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import com.org.momo.bean.PageInfo; import com.org.momo.bean.Team; import com.org.momo.dao.TeamDao; public class TeamDaoHibernateTemplate extends HibernateDaoSupport implements TeamDao { public void deleteById(Integer id) throws Exception { Team team = this.getHibernateTemplate().load(Team.class, id) ; this.getHibernateTemplate().delete(team) ; } public List<Team> findAll() throws Exception { return this.getHibernateTemplate().loadAll(Team.class); } public Team findById(Integer id) throws Exception { List<Team> teams = this.getHibernateTemplate().find("from Team where id=?",id) ; if(!teams.isEmpty()){ return teams.get(0) ; }else{ return null; } } public void insert(Team team) throws Exception { this.getHibernateTemplate().save(team) ; } public void update(Team team) throws Exception { this.getHibernateTemplate().update(team); } public List<Team> findAllPage(final PageInfo pageInfo) throws Exception { List<Team> teams = null; int rowTotal = ((Long)this.getHibernateTemplate().find("select count(id) from Team").get(0)).intValue(); int pageTotal = rowTotal/pageInfo.getPageRows(); if(rowTotal%pageInfo.getPageRows() > 0) { pageTotal++; } pageInfo.setPageTotal(pageTotal); teams = this.getHibernateTemplate().executeFind(new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { Query query = session.createQuery("from Team"); query.setFirstResult(pageInfo.getPageRows()*(pageInfo.getCurrentPage()-1)); query.setMaxResults(pageInfo.getPageRows()); return query.list(); } }); return teams; } }
spring的配置文件applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean id="teamService" class="com.org.momo.service.impl.TeamServiceImpl"> <property name="teamDao" ref="teamDao"></property> </bean> <bean id="adminService" class="com.org.momo.service.impl.AdminServiceImpl"> <property name="adminDao" ref="adminDao"></property> </bean> <bean id="logService" class="com.org.momo.service.impl.LogServiceImpl"> <property name="logDao" ref="logDao"></property> </bean> <bean id="studentService" class="com.org.momo.service.impl.StudentServiceImpl"> <property name="studentDao" ref="studentDao"></property> </bean> [color=brown]<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="configLocation" value="classpath:hibernate.cfg.xml"/> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="teamDao" class="com.org.momo.dao.hibernateTemplate.TeamDaoHibernateTemplate"> <property name="hibernateTemplate" ref="hibernateTemplate"/> </bean>[/color] <bean id="adminDao" class="com.org.momo.dao.hibernateTemplate.AdminDaoHibernateTemplate"> <property name="hibernateTemplate" ref="hibernateTemplate"/> </bean> <bean id="logDao" class="com.org.momo.dao.hibernateTemplate.LogDaoHibernateTemplate"> <property name="hibernateTemplate" ref="hibernateTemplate"/> </bean> <bean id="studentDao" class="com.org.momo.dao.hibernateTemplate.StudentDaoHibernateTemplate"> <property name="hibernateTemplate" ref="hibernateTemplate"/> </bean> <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"> </bean> </beans>
4.业务层:service接口和接口实现类serviceImpl:
package com.org.momo.service; import java.util.List; import com.org.momo.bean.PageInfo; import com.org.momo.bean.Team; import com.org.momo.dao.TeamDao; public interface TeamService { public TeamDao getTeamDao() ; public void setTeamDao(TeamDao teamDao) ; public void addTeam(Team team) throws Exception ; public void deleteTeam(Integer id) throws Exception ; public Team getTeam(Integer id) throws Exception ; public List<Team> getTeams() throws Exception ; public void updateTeam(Team team) throws Exception ; public List<Team> pageTeams(PageInfo page) throws Exception ; } package com.org.momo.service.impl; import java.util.List; import com.org.momo.bean.PageInfo; import com.org.momo.bean.Team; import com.org.momo.dao.TeamDao; import com.org.momo.service.TeamService; public class TeamServiceImpl implements TeamService { private TeamDao teamDao ; public void addTeam(Team team) throws Exception { teamDao.insert(team) ; } public void deleteTeam(Integer id) throws Exception { teamDao.deleteById(id) ; } public Team getTeam(Integer id) throws Exception { return teamDao.findById(id) ; } public TeamDao getTeamDao() { return teamDao; } public List<Team> getTeams() throws Exception { return teamDao.findAll() ; } public void setTeamDao(TeamDao teamDao) { this.teamDao = teamDao ; } public void updateTeam(Team team) throws Exception { teamDao.update(team) ; } public List<Team> pageTeams(PageInfo page) throws Exception { return teamDao.findAllPage(page) ; } }
5.控制层Action类:
package com.org.momo.action.team; import java.io.PrintWriter; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionSupport; import com.org.momo.bean.PageInfo; import com.org.momo.bean.Team; import com.org.momo.service.TeamService; import com.org.momo.util.JsonUtil; import com.org.momo.util.XmlUtil; public class ViewTeamsJSONAction extends ActionSupport { @Resource private TeamService teamService; private PageInfo pageInfo ; public PageInfo getPageInfo() { return pageInfo; } public void setPageInfo(PageInfo pageInfo) { this.pageInfo = pageInfo; } public String execute() { HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType("text/plain;charset=GBK"); try { PrintWriter out = response.getWriter(); //设置每页显示多少行 pageInfo.setPageRows(5) ; //获取所有小组 List<Team> teams = teamService.pageTeams(pageInfo) ; out.println(JsonUtil.teamsToJsonPage(teams, pageInfo)); //将document转换为String输出 out.flush() ; out.close() ; } catch (Exception e) { e.printStackTrace() ; } return NONE; } }
6.struts2的配置文件struts.xml
<?xml version="1.0" encoding="GBK"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0 //EN" "struts-2.1.7.dtd"> <struts> <constant name="struts.i18n.encoding" value="GBK"></constant> <package name="team" namespace="/team" extends="struts-default"> <interceptors> <interceptor name="LogInterceptor" class="com.org.momo.interceptor.LogInterceptor"></interceptor> <interceptor-stack name="TeamInterceptor"> <interceptor-ref name="defaultStack"></interceptor-ref> <interceptor-ref name="LogInterceptor"></interceptor-ref> </interceptor-stack> </interceptors> <default-interceptor-ref name="TeamInterceptor"></default-interceptor-ref> <action name="TeamNameCheck" class="com.org.momo.action.team.TeamNameCheckAction"> </action> <action name="ViewTeamsXML" class="com.org.momo.action.team.ViewTeamsXMLAction"> </action> <action name="ViewTeamsXSL" class="com.org.momo.action.team.ViewTeamsXSLAction"> </action> [color=red]<action name="ViewTeamsJSON" class="com.org.momo.action.team.ViewTeamsJSONAction"> </action>[/color] <action name="ViewTeams" class="com.org.momo.action.team.ViewTeamsAction"> <result name="success">/team/viewTeams.jsp</result> <result name="error">/team/exception.jsp</result> </action> <action name="DeleteTeam" class="com.org.momo.action.team.DeleteTeamAction"> <result name="success" type="redirect">/team/ViewTeams</result> <result name="error">/team/exception.jsp</result> </action> <action name="ViewUpdateTeam" class="com.org.momo.action.team.UpdateTeamViewAction"> <result name="success">/team/updateTeam.jsp</result> <result name="error">/team/exception.jsp</result> </action> <action name="UpdateTeam" class="com.org.momo.action.team.UpdateTeamAction"> <result name="success" type="redirect">/team/ViewTeams</result> <result name="error">/team/exception.jsp</result> </action> <action name="AddTeam" class="com.org.momo.action.team.AddTeamAction"> <result name="success" type="redirect">/team/ViewTeams</result> <result name="error">/team/exception.jsp</result> <result name="input">/team/addTeam.jsp</result> </action> </package> <package name="admin" namespace="/admin" extends="struts-default"> <interceptors> <interceptor name="LogInterceptor" class="com.org.momo.interceptor.LogInterceptor"></interceptor> <interceptor-stack name="TeamInterceptor"> <interceptor-ref name="defaultStack"></interceptor-ref> <interceptor-ref name="LogInterceptor"></interceptor-ref> </interceptor-stack> </interceptors> <default-interceptor-ref name="TeamInterceptor"></default-interceptor-ref> <action name="Login" class="com.org.momo.action.admin.LoginAction"> <result name="success">/index.jsp</result> <result name="input">/login.jsp</result> <result name="error">/team/exception.jsp</result> </action> <action name="UpdatePassword" class="com.org.momo.action.admin.UpdatePasswordAction"> <result name="success">/team/index.jsp</result> <result name="error">/team/exception.jsp</result> </action> </package> <package name="student" namespace="/student" extends="struts-default"> <interceptors> <interceptor name="LogInterceptor" class="com.org.momo.interceptor.LogInterceptor"></interceptor> <interceptor-stack name="TeamInterceptor"> <interceptor-ref name="defaultStack"></interceptor-ref> <interceptor-ref name="LogInterceptor"></interceptor-ref> </interceptor-stack> </interceptors> <default-interceptor-ref name="TeamInterceptor"></default-interceptor-ref> <action name="AddStudent" class="com.org.momo.action.student.AddStudentAction"> <result name="success" type="redirect">/student/ViewStudents</result> <result name="error">/student/exception.jsp</result> </action> <action name="ViewStudents" class="com.org.momo.action.student.ViewStudentsAction"> <result name="success">/student/viewStudent.jsp</result> <result name="error">/student/exception.jsp</result> </action> <action name="DeleteStudent" class="com.org.momo.action.student.DeleteStudentAction"> <result name="success" type="redirect">/student/ViewStudents</result> <result name="error">/student/exception.jsp</result> </action> <action name="ViewUpdateStudent" class="com.org.momo.action.student.ViewUpdateStudentAction"> <result name="success">/student/updateStudent.jsp</result> <result name="error">/student/exception.jsp</result> </action> <action name="UpdateStudent" class="com.org.momo.action.student.UpdateStudentAction"> <result name="success" type="redirect">/student/ViewStudents</result> <result name="error">/student/exception.jsp</result> </action> </package> </struts>
7.JSONUtil处理类:
package com.org.momo.util; import java.util.List; import com.org.momo.bean.PageInfo; import com.org.momo.bean.Student; import com.org.momo.bean.Team; public class JsonUtil { public static String teamsToJsonPage(List<Team> teams,PageInfo pageInfo)throws Exception { String jsonStr = null; StringBuffer strBuffer = new StringBuffer(); strBuffer.append("{"); //处理teams //teams开始 strBuffer.append("\"teams\":["); //处理teams for(int i=0;i<teams.size();i++) { Team team = teams.get(i); //team开始 strBuffer.append("{"); //处理id strBuffer.append("\"id\":"); strBuffer.append(team.getId()); strBuffer.append(","); //处理name strBuffer.append("\"name\":\""); strBuffer.append(team.getName()); strBuffer.append("\","); //处理leader strBuffer.append("\"leader\":\""); strBuffer.append(team.getLeader()); strBuffer.append("\","); //处理slogan strBuffer.append("\"slogan\":\""); strBuffer.append(team.getSlogan()); strBuffer.append("\","); //处理members strBuffer.append("\"members\":\"") ; if(team.getMembers()!=null){ int j=0 ; for(Student stu:team.getMembers()){ j++ ; strBuffer.append(stu.getName()) ; if(j<team.getMembers().size()){ strBuffer.append(",") ; } } } strBuffer.append("\"") ; //team结束 if(i<teams.size()-1) { strBuffer.append("},"); } else { strBuffer.append("}"); } } //teams结束 strBuffer.append("],"); //pageInfo开始 strBuffer.append("\"pageInfo\":{"); //处理pageRows strBuffer.append("\"pageRows\":"); strBuffer.append(pageInfo.getPageRows()); strBuffer.append(","); //处理currentPage strBuffer.append("\"currentPage\":"); strBuffer.append(pageInfo.getCurrentPage()); strBuffer.append(","); //处理pageTotal strBuffer.append("\"pageTotal\":"); strBuffer.append(pageInfo.getPageTotal()); //pageInfo结束 strBuffer.append("}"); //json结束 strBuffer.append("}"); jsonStr = strBuffer.toString(); return jsonStr; } }
8.前台界面JSP+javascript+AJAX(读取保存了teamsinfo和pageInfo的JSON字符串)
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%> <% String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/"; %> <html> <head> <base href="<%=basePath%>"> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <title>显示小组(Ajax)</title> <link rel="stylesheet" type="text/css" href="css/team.css" /> <script type="text/javascript" src="js/trim.js"></script> <script type="text/javascript"> function startRequest(pageNo) { createXMLHttpRequest(); xmlHttp.onreadystatechange = function() { handleStateChange(pageNo); }; xmlHttp.open("POST","team/ViewTeamsJSON",true); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); xmlHttp.send("pageInfo.currentPage=" + pageNo); } function handleStateChange(pageNo) { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { var text = xmlHttp.responseText ; var jsonObject = eval ("(" + text + ")"); var teamTable = document.getElementById("teamTable"); //alert(text) ; //清除原有数据 for(var i=teamTable.rows.length-1;i>0;i--){ teamTable.deleteRow(i) ; } for(var i=0;i<jsonObject.teams.length;i++) { //为表格加一行 var tr = teamTable.insertRow(i+1); //为表格加一个格 var td = tr.insertCell(0); td.innerHTML = jsonObject.teams[i].id; //为表格加一个格 var td = tr.insertCell(1); td.innerHTML = jsonObject.teams[i].name; //为表格加一个格 var td = tr.insertCell(2); td.innerHTML = jsonObject.teams[i].leader; //为表格加一个格 var td = tr.insertCell(3); td.innerHTML = jsonObject.teams[i].slogan; //为表格加一个格 var td = tr.insertCell(4); td.innerHTML = jsonObject.teams[i].members; //为表格加一个格 var td = tr.insertCell(5); td.innerHTML = "<a href='team/ViewUpdateTeam?team.id="+jsonObject.teams[i].id+"'>修改</a> <a href='team/DeleteTeam?team.id="+jsonObject.teams[i].id+"'>删除</a>"; } //处理页面跳转的连接 var pageDiv = document.getElementById("page") ; var pageTotal = jsonObject.pageInfo.pageTotal ; var pageHtml =" "; if(pageNo>1){ pageHtml += "<a href='javascript:startRequest("+ 1 +")'>首页</a> " ; //可以改为上一页 "1" 改为: (pageNo-1) } for(i = 0 ; i < pageTotal; i ++){ pageHtml += "<a href = 'javascript:startRequest("+(i+1)+")'>"+(i+1)+"</a> "; } if(pageNo < pageTotal) { pageHtml += " <a href='javascript:startRequest(" + pageTotal + ")'>尾页</a>"; //可以改为下一页 pageTotal 改为: (pageNo+1) } pageDiv.innerHTML = pageHtml ; } } } </script> </head> <body onload="startRequest(1)"> <div id="top"> <h1>显示小组</h1> </div> <div id="content"> <table border="1" id="teamTable"> <tr> <th>ID</th><th>组名</th><th>组长</th><th>口号</th><th>成员</th><th>操 作</th> </tr> </table> </div> <p><div id="page"></div> <p><a href="team/index.jsp">返回小组管理</a> </body> </html>
发表评论
-
网页爬取
2013-09-05 13:10 1065网页爬取 参考: 1.http://www.csdnjava ... -
Response返回的ContentType类型
2013-07-10 16:32 9850Response返回的ContentType类型 ajax开 ... -
浏览器插件集合(火狐+谷歌)
2013-07-03 10:26 1161Change Host 引用c:\windows\syste ... -
【32位和64位不同的操作系统】环境的配置
2013-07-02 13:34 1202【32位和64位不同的操作 ... -
跨域共享Cookies
2013-06-29 22:23 12397跨域共享Cookies 正常的cookie只能在一个应用中 ... -
代码托管Eclipse插件--Egit使用(GitHub)
2013-06-09 00:09 4868代码托管Eclipse插件--Egit使用(GitHub) ... -
FindBugs简介
2013-05-14 16:18 1328FindBugs简介 一、介绍 FindBugs 是一个静态 ... -
常用Java代码质量检测评估工具
2013-05-14 16:07 8389常用Java代码质量检测评估工具 1. PMD fro ... -
乱码解决
2013-05-09 16:31 1005乱码解决 1.超链接发送参数: 发送的时候使用URLEnc ... -
JAVA操作Excel
2013-05-05 15:02 958JAVA操作Excel JAVA 通常有两种方法来操作Ex ... -
Ajax异步刷新
2013-04-25 17:56 1047Ajax异步刷新 一、Ajax获得String类型数据: ... -
JavaMail邮件发送Demo
2012-12-26 11:37 3086JavaMail邮件发送Demo import com ... -
Ajax介绍(用户注册验证)
2012-11-11 21:19 1086Ajax,检查用户名是否存在 Ajax ... -
XSL介绍
2012-11-11 21:09 1293XSL扩展标记语言 ... -
上传功能的实现(Struts2)
2012-10-12 09:18 1149上传功能的实现(Struts2) 在WebRoot根目录新建 ... -
简单的下载功能实现(struts2)
2012-09-14 22:36 1061简单的下载功能实现(struts2)1.前台页面: & ... -
登陆验证码(Servlet实现)
2012-09-14 22:27 7424登陆验证码(Servlet实现) 1.前台登陆界面: &l ... -
JSON
2012-09-14 16:28 1156... -
登陆验证码(struts2实现)
2012-09-14 00:08 10317登陆验证码(struts2实现) 1.login.jsp & ... -
XSL 和 XSLT的区别
2012-09-13 14:48 2971《XSL扩展标记语言》 1. ...
相关推荐
SSH整合指的是Spring、Struts和Hibernate这三大框架的集成应用,它们是...这些文件共同构成了一个完整的SSH+JSON+Jquery+Ajax的示例应用,展示了如何在实际开发中有效地组合使用这些技术,以实现高效、互动的Web应用。
通过这个项目,开发者可以学习如何配置SSH框架,编写Action类,设置Action Mapping,使用Hibernate进行数据操作,以及如何在页面上利用Ajax和jQuery展示和处理JSON数据,同时实现分页和基本的CRUD功能。
这个小程序利用SSH2(Struts2、Spring、Hibernate)框架,结合Maven构建工具,实现了通过jQuery的datagrid插件进行Ajax分页加载数据的功能。以下将详细介绍其中涉及的技术和知识点。 1. **SSH2框架**:SSH2是Java ...
在IT行业中,SSH整合EasyUI实现添加、删除和分页是一项常见的前端与后端交互功能。这个主题涉及到几个关键的技术领域,包括Struts2(S)、Spring(S)和Hibernate(H),以及EasyUI和MySQL数据库。下面我们将深入...
4. **无刷新分页**:在浏览大量数据时,通过 AJAX 实现分页,只加载当前页的数据,提高性能。 **四、整合 SSH 实现 AJAX** 1. **Struts 配置**:在 Struts 配置文件中,需要定义一个 AJAX 动作,指定其处理类和...
8. **实现jqGrid前端**:在JSP页面中引入jqGrid的JavaScript和CSS文件,配置jqGrid的参数,与后端进行Ajax通信获取数据。 9. **测试与调试**:运行项目,测试查询功能是否正常,确保数据能正确显示在jqGrid中。 ...
以上内容涵盖了jQuery EasyUI和ExtJS的组件、JSON对象、B/S架构中的Session机制、Ajax在不同浏览器的实现以及FTP与SFTP的区别。这些知识点在实际的Web开发中非常重要,理解和掌握它们能帮助开发者更高效地构建和维护...
8. **数据库分页显示**:Criteria API,HQL,SQL。 9. **Spring对象事件**:ApplicationEvent,ApplicationListener。 10. **事务管理**:Spring的@Transactional注解。 11. **日志管理**:Spring AOP进行系统日志...
数字证书:从文件中读取数字证书,生成文件输入流,输入文件为c:/mycert.cer,获取一个处理X.509证书的证书工厂…… Java+ajax写的登录实例 1个目标文件 内容索引:Java源码,初学实例,ajax,登录 一个Java+ajax写的...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...
GWT Advanced Table 是一个基于 GWT 框架的网页表格组件,可实现分页数据显示、数据排序和过滤等功能! Google Tag Library 该标记库和 Google 有关。使用该标记库,利用 Google 为你的网站提供网站查询,并且可以...