摘要: ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml"); Student student = (Student) ac.getBean("student"); System.out.println("name "+student.getName()); //从 数组中循环取值; ... 阅读全文
posted @ 2017-03-26 11:16 Mr.xiaobai丶 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 在JSP页面获取当前项目名称的方法:方法1: 方法2: 使用EL表达式(如果不清楚EL表达式是什么,大家可以百度一下)${pageContext.request.contextPath}struts-html标签c标签post提交myXmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded")... 阅读全文
posted @ 2017-03-26 11:15 Mr.xiaobai丶 阅读(123) 评论(0) 推荐(0) 编辑
摘要: u ssh整合** ssh(struts+spring+hibernate) 三大框架配合使用来开发项目,是目前java ee 最流行的开发方式,必须掌握.**设计: 这我们通过一个实际的案例,来讲解整合 , 我们使用一个雇员薪资管理系统(crud),每加入一个框架,我们就测试通过具体的步骤:1.创建web项目 ① 先搞定spring② 引入spring开发包③ ... 阅读全文
posted @ 2017-03-26 11:14 Mr.xiaobai丶 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1.获取XMLHttpResponse对象;(1号线)function getXMLHttpRequest(){ try { //火狐浏览器xmlHttpRequest=new XMLHttpRequest(); } catch (e) { //IE浏览器xmlHttpRequest=new ActiveXObject("Microsoft.XMLHTTP"); } return xmlHt... 阅读全文
posted @ 2017-03-26 11:14 Mr.xiaobai丶 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 整体思路: 1首先实现登陆功能,1.创建web项目,引入jar包2.创建user表 和messages表,使用逆向工程创建domin对象;create table users(id int primary key,name varchar(32) not null unique,password varchar(32) not null,regtime date not null,islogin ... 阅读全文
posted @ 2017-03-26 11:13 Mr.xiaobai丶 阅读(628) 评论(0) 推荐(0) 编辑
摘要: 1.SSH知识点回顾2.搭建SSH开发环境3.struts2整合spring-->spring整和hibernate4.案例:使用ssh框架开发人员管理系统1.ssh知识点回顾通常的web应用开发可以分为三层结构:"web层","业务层","持久层". 2.SSH环境搭建 * 引入struts2的jar包 * 了解的jar包 struts-convention-plug... 阅读全文
posted @ 2017-03-25 21:34 Mr.xiaobai丶 阅读(206) 评论(0) 推荐(0) 编辑
摘要: MyEclipse自动生成hibernate实体类和配置文件攻略 2012-08-21 10:20:54| 分类: ssh|举报|字号 订阅 下载LOFTER我的照片书 |步骤1:找到导航栏里面的window--showView然后输入db brower,打开数据库浏览窗口步骤2:在数据库浏览窗口里只有一个Myeclipse自带的数据库,该数据没有用,我们在空白的地方右键新建一个数... 阅读全文
posted @ 2017-03-25 21:30 Mr.xiaobai丶 阅读(182) 评论(0) 推荐(0) 编辑
摘要: //测试类public class studentsTest{ private Configuration config;// 1.声明私有配置对象类private ServiceRegistry serviceRegistry;// 2.声明私有服务注册对象类private SessionFactory sessionFactory;// 3.声明私有会话工厂对象类private Session... 阅读全文
posted @ 2017-03-25 21:30 Mr.xiaobai丶 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 该类创建遵循javabean的创建的四大规则1.共有的类2.提供公有的不带参数的默认的构造方法3. 属性要私有化private4.属性setter/getter封装null 阅读全文
posted @ 2017-03-25 21:29 Mr.xiaobai丶 阅读(298) 评论(0) 推荐(0) 编辑
摘要: hibernate缓存一级缓存u 为什么需要缓存?看一个案例:->原理图从上图看出: 当我们去查询对象的时候,首先到一级缓存去取数据,如果有,则不到数据库中取,如果没有则到数据库中取,同时在一级缓存中放入对象.二级缓存 u 为什么需要二级缓存?因为一级缓存有限(生命周期短),所以我们需要二级缓存(SessionFactory缓存)来弥补这个问题1.需要配置2.二级缓存是交给第三方去处理,常见的... 阅读全文
posted @ 2017-03-25 21:28 Mr.xiaobai丶 阅读(191) 评论(0) 推荐(0) 编辑