随笔 - 6  文章 - 129  trackbacks - 0
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿(14)

随笔档案(6)

文章分类(467)

文章档案(423)

相册

收藏夹(18)

JAVA

搜索

  •  

积分与排名

  • 积分 - 814912
  • 排名 - 49

最新评论

阅读排行榜

评论排行榜

java
java对象序列化数组和反序列化      摘要: java对象序列化数组和反序列化   阅读全文
posted @ 2011-09-16 10:51 Ke 阅读(5304) | 评论 (0)  编辑
使用response方法清除浏览器缓存      摘要: response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);   阅读全文
posted @ 2011-02-12 17:19 Ke 阅读(922) | 评论 (0)  编辑
config.getServletContext().getRealPath("/")返回NULL的解決辦法      摘要: java.net.URL url = this.getClass().getResource("/");
String mSchemaPath = url.getFile();
if (mSchemaPath != null || !mSchemaPath.equals("")) {
String separator = "/";
int lastSlash = mSchemaPath.lastIndexOf(separator);
if (lastSlash == -1) {
separator = "\\";
lastSlash = mSchemaPath.lastIndexOf(separator);
}
prefix = mSchemaPath.substring(0, lastSlash);  阅读全文
posted @ 2010-12-03 22:06 Ke 阅读(2402) | 评论 (0)  编辑
ServletContext Properties 操作文件      摘要: FileOutputStream fos = null;
try {
new File(sc.getRealPath("WEB-INF") + "/" + optionsFilename).delete();
fos = new FileOutputStream(sc.getRealPath("WEB-INF") +
"/" + optionsFilename);
props.store(fos, null);
fos.flush();
result = "Options have been saved.";
} catch (IOException e) {
log.error("Error saving contact:");
  阅读全文
posted @ 2010-03-09 22:19 Ke 阅读(472) | 评论 (0)  编辑
日記過濾器      摘要: filterConfig.getServletContext().log(
"User access! " +
" User IP: " + address +
" Resource: " + file +
" Milliseconds used: " + (System.currentTimeMillis() - start)
);  阅读全文
posted @ 2009-12-21 10:35 Ke 阅读(242) | 评论 (0)  编辑
spring注解入门(轉)      摘要: 的base-package属性指定了需要扫描的类包,类包及其递归子包中所有的类都会被处理。
还允许定义过滤器将基包下的某些类纳入或排除。Spring支持以下4种类型的过滤方式:

* 过滤器类型 表达式范例 说明
* 注解 org.example.SomeAnnotation 将所有使用SomeAnnotation注解的类过滤出来
* 类名指定 org.example.SomeClass 过滤指定的类
* 正则表达式 com\.kedacom\.spring\.annotation\.web\..* 通过正则表达式过滤一些类
* AspectJ表达式 org.example..*Service+ 通过AspectJ表达式过滤一些类

  阅读全文
posted @ 2009-09-15 15:20 Ke 阅读(354) | 评论 (0)  编辑
Java调用Oracle函数      摘要: Java调用Oracle函数  阅读全文
posted @ 2009-05-12 10:27 Ke 阅读(6334) | 评论 (2)  编辑
URLConnection在类里执行URL      摘要: HttpURLConnection urlcon = (HttpURLConnection)url.openConnection();  阅读全文
posted @ 2009-03-20 13:49 Ke 阅读(639) | 评论 (0)  编辑
Java中的内部类和匿名类      摘要: 内部类:一个内部类的定义是定义在另一个内部的类。
原因是:
1.一个内部类的对象能够访问创建它的对象的实现,包括私有数据。
2.对于同一个包中的其他类来说,内部类能够隐藏起来。
3.匿名内部类可以很方便的定义回调。
4.使用内部类可以非常方便的编写事件驱动程序。  阅读全文
posted @ 2007-11-16 22:57 Ke 阅读(279) | 评论 (0)  编辑
类之间的关系      摘要: UML把类之间的关系分为以下5种.
● 关联:类A与类B的实例之间存在特定的对应关系
● 依赖:类A访问类B提供的服务
● 聚集:类A为整体类,类B为局部类,类A的对象由类B的对象组合而成
● 泛化:类A继承类B
● 实现:类A实现了B接口  阅读全文
posted @ 2007-10-21 19:36 Ke 阅读(352) | 评论 (0)  编辑
继承
posted @ 2007-10-02 09:37 Ke 阅读(215) | 评论 (0)  编辑