zoukankan      html  css  js  c++  java
  • struts 2 时间控件

    在使用struts2框架时,为我们提供了时间选择器控件:datetimepicker。但是在使用过程中会出现一些问题,主要就是struts2版本更新时做了一些修改。在struts2.0时,使用<s:datetimepicker/>时,需要在<head></head>标签中申明:<s:head theme="ajax"/>.但在struts2.1.6时,struts2就不再单独提供主题ajax,而是将ajax主题整合到dojo包中。所以我们在使用struts2.1.6以上版本时,要在jsp页面中引入dojo的标签库:<%@ taglib="/struts-dodo-tags" prefix="sx"%>,而将<s:head theme="ajax"/>去掉。直接写上: <sx:head parseContent="true"/>  即可。在使用标签时这样写:<sx:datimepicker name="" displayFormat="yyyy-MM-dd"/>,还有很多属性可以在struts2帮助文档中查看。而如果在2.0以上版本使用<s:head theme="ajax"/>.将会报以下错误:

    Expression parameters.parseContent is undefined on line 45, column 28 in template/ajax/head.ftl。
    The problematic instruction:
    ----------
    ==> ${parameters.parseContent?string} [on line 45, column 26 in template/ajax/head.ftl]
    ----------
     注意在这里需要引入struts的一个jar包: struts2-dojo-plugin-2.x.x.jar。 
  • 相关阅读:
    SpringCloud组件---Ribbon
    SpringCloud组件---Eureka
    tomcat及Jetty远程调试debug
    mysql 删除重复数据
    mysql执行SQL语句时报错:[Err] 3
    线程池原理剖析
    上限下限
    线程池Executors、Callable与Future的应用
    spring获取bean(自定义工具类)
    java.util.concurrent.Exchanger应用范例
  • 原文地址:https://www.cnblogs.com/chcong/p/6192580.html
Copyright © 2011-2022 走看看