2008-07-30

20080730

标志位用boolean或者Boolean,设为varchar2(1),为true时会被保存为1,为false时会被保存为0. 当使用boolean时,如果不对该字段进行设置,那么不能进行存储,报错,不能将null存储到一个boolean中。但使用Boolean却可以正常存储,但是读出来的时候这个字段为null,不能用来进行判断(设置标志位就是用来做判断的,如果不能判断那么就没有意义了)。 现在标志位是新加的字段,那么原来的记录不去设置的话这个字段都为null,修改数据库是不太可能的了,只能选择用Boolan。单独写个方法用来处理这个字段,当为null时返回false,这样就没什 ...
Javascript中为String对象添加trim <script language=Javascript> //自己动手为string添加Trim function String.prototype.Trim() {return this.replace(/(^\s*)|(\s*$)/g,"");} function String.prototype.Ltrim(){return this.replace(/(^\s*)/g, "");} function String.prototype.Rtrim(){return this.replace(/(\s*$)/g, "");} & ...
问题: 两个js放到一起只能调用其中的一个,另外一个里面的方法失效。而且它们合并到一起新加的那些方法都不好使了。 参考: http://www.cnblogs.com/birdshome/archive/2005/03/23/120057.html http://www.cnblogs.com/calmzeal/archive/2006/05/21/405635.html js文件注意: 在一个页面中使用到多个js文件时,编码很重要,js文件的编码不同或者js文件和调用它们的jsp页面的编码不同都可能导致js文件中的方法失效。解决方法:在调用js文件时指定编码方式:<script ...
According to TLD or attribute directive in tag file, attribute value does not accept any expressions http://forums.sun.com/thread.jspa?threadID=683007&messageID=3978930 问题:本是想在<c:foreach...>标签里面用<%= CmsManagerFactory.getCmsManagerLocal().getNoDeletedImages(request.getParameter("id")) %>给ite ...
java.lang.OutOfMemoryError: Java heap space 附件下载代码,原代码: InputStream is = null; OutputStream os = null; FileData file= cmsMgr.getFile(fileId); // File为附件对象,其中的content属性为java.sql.Blob类型, size为附件大小 os = response.getOutputStream(); is = image.getContent().getBinaryStream(); byte fileContent = new byte[ ...
2008-07-29

20080728

1. current oracle关键字 2. pojo里面别用布尔类型的基本类型,使用包装类型(可能是:新加字段,里面有些记录的该字段为空) 3. boolean的属性在el里面${item.current}, current必须有getCurrent()而不能是isCurrent(),可能是版本比较老的原因 4. 新创建的pojo类里面的setData方法都违背了PersistentObject中的setData方法的本意(让一个同类的对象来设置本对象),这样一个问题就是在HibernateUtil里面如果setData被调用的话将出项ClassCastException,这里还原s ...
FCKeditor的分页符在IE和Firefox下面不同: IE:<div style="page-break-after: always"><span style="display: none"> </span></div> Firefox:<div style="page-break-after: always;"><span style="display: none;"> </span></div> 这本没有什么新奇的,但是用String.split()在IE下面可以分割成功,在Firefox下面确不能,追踪半天后才发现奇怪的是Fi ...
http://www.cnblogs.com/njnudt/archive/2008/06/26/1230386.html http://www.cnblogs.com/zhenyulu/archive/2007/02/08/644362.html 1.兼容firefox的剪贴板 createArticle = function(){ var ori = FCKeditorAPI.GetInstance("content").GetXHTML(true); //FCKeditorAPI.GetInstance("content").SetHTML(wellForm ...
超链接中target为: _blank 浏览器会另开一个新窗口显示document.html文档 2._parent 指向父frameset文档 3._self 把文档调入当前页框 4._top 去掉所有页框并用document.html取代frameset 小技巧 1:使别人的页框不能引用你的网页 在文件头加:<base target="_top"> 2:在当前页打开连接或做刷新,提交到当前页 在文件头加:<base target="_self">
模板或者包含文件的修改页面,在里面可以修改已经上传的图片,也可以继续删除图片,修改或者上传后部分刷新该修改页面以显示刚才的修改或者上传。页面可以分为四个部分: A:模板或者包含文件的描写信息,内容等 B:已经上传的图片(需要刷新,为一ifram,id为images) C:上传图片链接 D:隐藏iframe(id为newImage),上传或者修改图片时才显示,完成后关闭并刷新B 1.在D的链接页面里面点击“确定”时关闭D并同时刷新B function confirm(){ parent.getElementById("newImage").style.display = "none"; ...
function autoSize(win){ if (document.getElementById){ if (win && !window.opera){ if (win.contentDocument && win.contentDocument.body.offsetHeight) { win.height = win.contentDocument.body.offsetHeight; } else if(win.Document && win.Document.body.scrollHeight){ win.height = win ...
(http://www.javaeye.com/topic/124788)当使用 fail-fast iterator 对 Collection 或 Map 进行迭代操作过程中尝试直接修改 Collection / Map 的内容时,即使是在单线程下运行, java.util.ConcurrentModificationException 异常也将被抛出。   Iterator 是工作在一个独立的线程中,并且拥有一个 mutex 锁(http://www.cnblogs.com/city22/archive/2007/02/02/638260.html)。 Iterator 被创建之后会建立 ...