ITeye博客

寂寞的时光

xiexd · 共 96 篇文章

[Java]读取文件方法大全

[Java]读取文件方法大全 1、按字节读取文件内容 2、按字符读取文件内容 3、按行读取文件内容 4、随机读取文件内容 <!-- <br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->public class ReadFromFile { /** * 以字节为单位读取文件,常用于读二进制文件,如图片、声音、影像等文件。 */ public static void readFileByByte…

2010-11-03 15:32 · JAVA · 评论(0)

spring如何使用多个xml配置文件 【转】

1, 在web.xml中定义 contextConfigLocation参数.spring会使用这个参数加载.所有逗号分割的xml.如果没有这个参数,spring默认加载web-inf/applicationContext.xml文件. <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:conf/spring/applicationContext_core*.xml, classpath*:conf/spring/applicationContext_dict*.xm…

2010-10-26 16:54 · JAVA · 评论(0)

PHP定时

<? set_time_limit(0); ignore_user_abort(true); $i=1; while($i){ /* 处理事务 */ sleep(120); } exit; ?>

2010-10-19 17:15 · php · 评论(0)

深入iBatis的Cache[转载自javaeye---NetBus 的心得体会]

关键字: ibatis cache 概述 iBatis对查询结果集进行本地缓存。 Cache 的key由haskcode、checksum、查询参数、sqlmap Id、sql语句、调用方法名等构成。由此可以看出,不同的参数会有不同的Key。注意,他不是以查询参数的Class的hashcode或 toString方法作为key的一部分,而是以在sqlmap使用的变量的集合。 queryForObject和queryForList都可以缓存。其它片断不支持。 可以设定为定时刷新或受条件触发刷新Key。如:在执行Update的时候,可以刷新Cache。 刷新Cache时,无法手动控制刷新单条记录…

2010-10-15 12:27 · 评论(0)

如何指定tomcat中session过期时间

如何指定tomcat中session过期时间 1. 在server.xml中定义context时采用如下定义: <Context path="/livsorder" docBase="/home/httpd/html/livsorder" defaultSessionTimeOut="3600" isWARExpanded="true" isWARValidated="false" isInvokerEnabled="true" isWorkDirPersistent="false"/> 2. 在web.xml中通过参数指定: <session-config> <session-timeou…

2010-10-11 02:06 · JAVA · 评论(0)

获取参数日期的上月月末日期及下月月初日期

public static String getNewDate(String strDate,Integer flag){ if(null==strDate || "".equals(strDate) || null==flag ){ return null ; } Calendar cal = Calendar.getInstance(); String[] dateArr = strDate.split("-"); int year = Integer.parseInt(dateArr[0]); int month = Integer.parseInt(dateArr[1]); cal.…

2010-09-30 10:32 · JAVA · 评论(0)

webwork中workflow返回input的原因之一

表面现象: 当一个Action中既没有重写ActionSupport中的validate方法, 也没有相关的validata.xml文件, 并且action中并没有INPUT的出口, 但是最终LOG里面却告诉我们这个Action返回INPUT了. 这到底是怎么一回事呢.. 了解下代码: webwork中,如果有添加workflow这个interceptor, 那么ActionA chain到 ActionB的时候, 如果ActionA中有调用 addActionError这个方法, 然后chain到ActionB, 这时候ActionB不会做任何事情,就直接返回INPUT了 原因是: 在wo…

2010-09-27 10:15 · webwork/struct2 · 评论(0)

spring tx:advice 和 aop:config 配置事务

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" xmlns: aop = "http://www.springframework.org/schema/ aop " xmlns:tx = "http://www.springframework.org/schema/tx" xmlns:context = "…

2010-09-25 17:49 · spring · 评论(0)

SPRING配置问题

问:Spring 2.0,使用<aop:config>来配置AOP <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd"> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" …

2010-09-25 17:49 · spring · 评论(0)

Spring cvc-elt.1: Cannot find the declaration of element 'beans'.

Spring cvc-elt.1: Cannot find the declaration of element 'beans'. <script type="text/javascript"> document.body.oncopy = function () { if (window.clipboardData) { setTimeout(function () { var text = clipboardData.getData("text"); if (text && text.length > 300) { text = text + "\r\n\n本文来自CSDN博客,转载请标…

2010-09-25 16:59 · spring · 评论(0)

c# 冒号:C#中两个冒号(::)的作用

global::System.Console.WriteLine(number); 冒号在什么地方用. 点是空间下类,表示下一层的意思? 这里面::前面是GAC的标示符global,用法比较特殊,和.不是一个类型的东西。 global 是 C# 2.0 中新增的关键字,理论上说,如果代码写得好的话,根本不需要用到它。 假设你现在写了一个类,名字叫 System。那么当你再在代码里写 System 的时候,编译器就不知道你是要指你写的 System 类还是系统的 System 命名空间,而 System 命名空间已经是根命名空间了,无法再通过完全限名来指定。在以前的 C# 版本中,这就是一个无…

2010-09-02 16:13 · c# · 评论(0)

固定宽度CSS版式布局

固定宽度CSS版式布局 [![3列固定宽度居中+头部](http://cssdiv.net/templets/default/images/lay

2010-08-31 15:14 · DIV+CSS · 评论(0)

div+css布局

今天发现了一个不错的css+div布局网站。学习css+div的童鞋不妨可以参考下。共50种布局。 地址: http://cssdiv.net/layout/ 截图:

2010-08-31 15:12 · JAVASCRIPT&&DHTML · 评论(0)

WEB QQ 网页登陆QQ QQ的HTTP接口探究

amxku 发表于 2006-11-30, 10:13. 发表在: 技术相关 1、研究说明 Tencent在tqq.tencent.com的8000有一个使用HTTP的QQ接口,通过这个接口,可以进行一些基本的操作,如:登陆、 登出、改变登陆状态(上线、忙碌、离线、隐身)、添加删除好友、查看好友信息、发送验证信息(接受被加为好友、申请加对方为好友、拒绝被加为好友)、收发 用户消息、系统信息。 目前我研究的是1.1版本的HTTP QQ协议,研究是微程在的成果上进行的,不敢说有什么超越,只不过更为详细和准确。 2、接口说明: 接口位置:tqq.tencent.com:8000 通信协议:HTTP…

2010-08-30 16:37 · 网络 · 评论(0)

网上常用免费WebServices集合

网上常用免费WebServices集合 2010-08-17 16:26:00 来自:博客园-首页原创精华区 天气预报 Web服务,数据来源于中国气象局 公用事业 http://www.webxml.com.cn/WebServices/WeatherWebService.asmx 中国股票行情 分时走势预览缩略图 http://www.webxml.com.cn/webservices/ChinaStockSmallImageWS.asmx 中国股票行情数据 WEB 服务(支持深圳和上海股市的基金、债券和股票) http://www.webxml.com.cn/WebServices/Ch…

2010-08-18 10:08 · 资源 · 评论(0)