以下代码可以解决这个问题:if(cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC
&& cell.getCellStyle().getDataFormat() ==
HSSFDataFormat.getBuiltinFormat("h:mm")){
String sDate = cell.getNumericCellValue()+"";
if(!StringUtil.isEmpty(sDate)){
Date date = HSSFDateUtil.get ...
- 16:05
- 浏览 (94)
- 评论 (0)
在使用move/rename功能时,点击输入框的右边的search按钮,OpenCms会弹出一个对话框让你选择move的路径,怎样在自己的页面里面调用这个弹出窗口呢?以下代码揭示了方法: <script type="text/javascript">
function openTreeWin(treeType, includeFiles, formName, fieldName, curDoc) {
var paramString = "";
if (treeType) {
paramString += &q ...
2008-03-20
How to set a value in a xmlcontent resource
关键字: how to set a value in a xmlcontent resource programtically
我引用两个老外的代码来说明问题:如果你使用这一段代码,试图改变一个xmlcontent的内容的话,你不会成功CmsResource document = (CmsResource) cms.getCmsObject().readResource(xmlcontentPath);
CmsXmlContent xmlContent = CmsXmlContentFactory.unmarshal(cms.getCmsObject(), document, request);
xmlContent.getValue("Date", cms.getRequestCont ...
直接调用过OpenCms api的肯定知道,org.opencms.xml.content.CmsXmlContent有两种获得value的方法:public CmsXmlContentValueSequence getValueSequence(java.lang.String name, &nbs ...
east_java 兄问我static export如何操作,我给他说明一下,其实非常简单: 登陆OpenCms,在最顶上的菜单里面选择:view=Administration 再选择DataBaseManagement,然后在Additional tools里面选择start static export,然后顺着wizard一步一步往下就可以了。如果遇到404问题,可以参照OpenCms static export 404 error 这篇文章。希望对你有帮助。
2008-03-14
java.sql.SQLException: Data truncated for column '
关键字: java.sql.sqlexception: data truncated for column 'xxx' at ro
今天遇到了一个jdbc的异常:
java.sql.SQLException: Data truncated for column 'XXX' at row 1在http://forums.mysql.com/read.php?39,57206,57366上面找到了原因,贴出来和大家共享,原因是column 'XXX'在数据库里面定义的是Float类型,而我在set PreparedStatement的时候,把值设成了string(st.setString(index, value)),实际上应该调用setFloat,和mysql那篇文章犯了同样的错误。
- 19:42
- 浏览 (215)
- 评论 (0)
以下代码的作用是使用Java正则表达式从字符串:"fdkaljjdklafj12345.6789afjakfdall34567.89fdsalffsafa"分离出数字。 Matcher m = Pattern.compile("[\\d.]+").matcher("fdkaljjdklafj12345.6789afjakfdall34567.89fdsalffsafa");
m.find();
String value = m.group();
Float lValue = Float. ...
2008-03-13
Eclipse plugins for firefox extension development
关键字: eclipse plugins for firefox extension development
介绍两个用于开发firefox extension 的eclipse 插件:
1.XulBrooster: http://cms.xulbooster.org/
2.Spket IDE: http://www.spket.com/download.html
- 15:49
- 浏览 (185)
- 评论 (0)
with 语句通常用来缩短特定情形下必须写的代码量。在下面的例子中,请注意 Math 的重复使用:
x = Math.cos(3 * Math.PI) + Math.sin(Math.LN10)
y = Math.tan(14 * Math.E)
当使用 with 语句时,代码变得更短且更易读:
with (Math){
x = cos(3 * PI) + sin (LN10)
y ...
- 20:28
- 浏览 (100)
- 评论 (0)
如果想在OpenCms发布数据的同时do something怎么办呢?你可以使用PublishListener,publish事件监听器,OpenCms有事件的概念,有点类似javascript的listener。下面我就教你怎么写一个完整的Publish监听器。 第一步:创建一个ActionClass继承org.opencms.module.I_CmsModuleActionimport org.opencms.configuration.CmsConfigurationManager;
import org.opencms.db.CmsPublishList;
import ...
if static export is disabled nothing is exported and the rules are notused.For the handeling of the link tags one standard rule is generated withthe url_prefix_http value. So you can still configure the servletpath.staticexport.enabled=truethe static export is controlled by the resource property exp ...
javascript 程序在第一次获得一个页面对象,比如var el = document.getElementById('div1'); 这个时候如果你取el.style.width,你可能得到的值为''值,除非你设置了el.style.width,比如el.style.width="200px";然后你再alert(el.style.width);这时才会弹出'200px'。可是css里面明明设置了这个值为什么没有值呢,原来初始值不再style.width里面,在currentstyle里面,调用以下代码,即使在第一次取style的值也是可行的(IE,FF测试通过):
<styl ...
- 浏览: 12163 次

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
POI拷贝Sheet包括每个单 ...
你好,你写的这个方法正式我说需要的,不过我有2个问题:1、该方法能实现两个不同的 ...
-- by jackini -
自己写OpenCms自定义结构 ...
老兄,这是按页面关键字进行搜索,你知道怎么按网页创建的时间进行搜索吗.急啊!!! ...
-- by zhouxiao315 -
opencms7.0.x plugin for ...
太好了,有更新了
-- by cai555 -
opencms7.0.x plugin for ...
我的环境:Myeclipse6.0(eclipse3.3.1)/openCMS7 ...
-- by foolpcman -
谁能告诉我为什么parseInt ...
居然被评为入门帖,不过还是感谢解答的各位
-- by cai555






评论排行榜