2016年11月25日

摘要: 文件上传 xml配置 文件下载 xml配置 //下载注意开启静态方法调用 阅读全文
posted @ 2016-11-25 22:10 梨_让孔融 阅读(155) 评论(0) 推荐(0)
摘要: 1. 拦截器 1.1 概述 ü 基本概念 Intercetor, 即为拦截器。 1) 在Struts2中,把每一个功能都用一个个的拦截器实现;用户想用struts的哪个功能的时候,可以自由组装使用。 2)Struts2中,为了方法用户对拦截器的引用,提供了拦截器栈的定义,里面可以包含多个拦截器。 文 阅读全文
posted @ 2016-11-25 22:05 梨_让孔融 阅读(109) 评论(0) 推荐(0)
摘要: Struts就是基于mvc模式的框架! (struts其实也是servlet封装,提高开发效率!) Struts开发步骤: 1. web项目,引入struts - jar包 2. web.xml中,引入struts的核心功能 配置过滤器 3. 开发action 4. 配置action src/str 阅读全文
posted @ 2016-11-25 21:58 梨_让孔融 阅读(212) 评论(0) 推荐(0)

2016年11月16日

摘要: 加载顺序 顺序 配置文件名 所在位置 说明 1 default.properties struts2-core-2.3.15.3.jar\org\apache\struts2 不能修改 2 struts-default.xml struts2-core-2.3.15.3.jar 不能修改 3 str 阅读全文
posted @ 2016-11-16 23:44 梨_让孔融 阅读(130) 评论(0) 推荐(0)
摘要: 一、Struts2简介 1、Struts2概述 Struts2是Apache发行的MVC开源框架。注意:它只是表现层(MVC)框架。 2、Struts2的来历 Struts1:也是apache开发的一套mvc的开源框架。在2005年之前非常流行。 弊端:Struts1的核心控制器就是一个Servle 阅读全文
posted @ 2016-11-16 23:39 梨_让孔融 阅读(182) 评论(0) 推荐(0)

2016年11月2日

摘要: 用连接池的方式连接数据库的几大重要步骤:步骤一: 1,将数据库的mysql-connector-java-5.0.8-bin.jar文件拷到tomcat安装目录下的lib文件夹中。 2,在Tomcat的conf/context.xml 注意:在配置文件中不允许有中文,包括注释内的中文<!--tomc 阅读全文
posted @ 2016-11-02 23:48 梨_让孔融 阅读(338) 评论(0) 推荐(0)
摘要: driverClassName=com.mysql.jdbc.Driverurl=jdbc:mysql://localhost:3306/mydb4username=rootpassword=admininitialSize=10maxActive=50maxIdle=20minIdle=5maxW 阅读全文
posted @ 2016-11-02 23:46 梨_让孔融 阅读(257) 评论(0) 推荐(0)
摘要: 1 static LinkedList list = new LinkedList();//线程不安全的集合 2 //线程安全的集合 3 //连接池 4 //static List list = Collections.synchronizedList(new LinkedList()); 5 static{ 6 Properties... 阅读全文
posted @ 2016-11-02 23:45 梨_让孔融 阅读(142) 评论(0) 推荐(0)
摘要: <?xml version="1.0" encoding="gbk"?><c3p0-config> <default-config> <!-- 连接数据库 --> <property name="driverClass">com.mysql.jdbc.Driver</property> <prope 阅读全文
posted @ 2016-11-02 23:42 梨_让孔融 阅读(101) 评论(0) 推荐(0)
摘要: 实现查询数据库中的数据显示在java的控制台中 //1,加载驱动 Class.forName(“数据库的驱动类”); //2,通过DriverManager得到获得连接 Connection conn = DriverManager.getConnection(String url,String u 阅读全文
posted @ 2016-11-02 23:35 梨_让孔融 阅读(110) 评论(0) 推荐(0)

导航