yaron's space
记录学习过程中的点点滴滴
记录学习过程中的点点滴滴
十二 27th
引言
HTTP 是一个属于应用层的面向对象的协议,由于其简捷、快速的方式,适用于分布式超媒体信息系统。它于1990年提出,经过几年的使用与发展,得到不断地完善和 扩展。目前在WWW中使用的是HTTP/1.0的第六版,HTTP/1.1的规范化工作正在进行之中,而且HTTP-NG(Next Generation of HTTP)的建议已经提出。
HTTP协议的主要特点可概括如下: 更多 >
十二 24th
从Integer到BigInteger转化直接,因为BigInteger的位数大于Integer.
今天遇到了从BigInteger到Integer的转化,直接强制类型转为会出错,需要用BigInteger类的intValue()函数来获得Integer值
BigInteger bigValue = 1111111;
Integer intValue = bigValue.intValue();
另外一种方式是 intValue = Integer.valueOf(bigValue.toString);//通过string来转化
十二 23rd
Invocation of init method failed; nested exception is org.hibernate.PropertyNotFoundException
解决办法:一般是hibernate对象与表的字段映射时出现问题
本文地址:http://www.yaronspace.cn/blog/index.php/archives/341
十二 22nd
可依次选择”window”>>”preferences”>>”general”>>”content types”
在右边的窗口中打开列表,选中”JavaScript”,在下面的”default encoding”右边的输入框中输入”GBK”或”GB2312″再点”update”按钮,再打开JS文件就可以
如果没有提供选择向,在下面的“文件关联”中添加一个“*.js”,然后指定编码为”GBK”或”GB2312″就可以了
十二 22nd
<s:date name=”user.lastLoginTime” format=”yyyy-MM-dd” />
属性name代表日期变量,format设置显示格式
具体格式说明请参看http://www.yaronspace.cn/blog/index.php/archives/295
十二 22nd
今天才知道hibernate原来对mysql中limit这个功能是不支持的,只能采用setMaxResults来实现
具体实现方法如下:
public List<Propertyhistory> getHistoryByServiceAndMeta(Integer serviceId, Integer metaId, Integer limitNum)
{
final Integer maxNum = limitNum;
final String sql = “from Propertyhistory where serviceId=”+serviceId+” and metaId=”+metaId+” order by modifiedTime DESC”;
List<Propertyhistory> list = super.getHibernateTemplate().executeFind(new HibernateCallback(){
public Object doInHibernate(Session session)
throws HibernateException, SQLException {
return session.createQuery(sql).setMaxResults(maxNum).list();
}});
return list;
}
十二 19th
作者: laruence(http://www.laruence.com)
很强悍呀,差距太大了,推荐两篇文章
下载下ppt
十二 18th
JavaScript的setTimeout与setInterval是两个很容易欺骗别人感情的方法,因为我们开始常常以为调用了就会按既定的方式执行, 我想不少人都深有同感, 例如
setTimeout( function(){ alert(’你好!’); } , 0);
setInterval( callbackFunction , 100);
认为setTimeout中的问候方法会立即被执行,因为这并不是凭空而说,而是JavaScript API文档明确定义第二个参数意义为隔多少毫秒后,回调方法就会被执行. 这里设成0毫秒,理所当然就立即被执行了.
同理对setInterval的callbackFunction方法每间隔100毫秒就立即被执行深信不疑! 更多 >
十二 18th
在jquery中,当使用$(“input[name='metaId']“).val()不能直接获得被选择的radio的值,只是获得radio标签的第一个值,这可能jquery使用xpath语言了进行查找有关,而我们通常是想获得被选中的radio的值,有以下几种方法:
1,使用$(“input[name='metaId']:checked”).val()获得 //name代表radio中name属性名
2,使用$(“:radio:checked”).val()获得 //限制页面只有一组radio标签
本文地址:http://www.yaronspace.cn/blog/index.php/archives/323
近期评论