惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
博客园 - 【当耐特】
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
D
Docker
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
罗磊的独立博客
小众软件
小众软件
A
About on SuperTechFans
MyScale Blog
MyScale Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
C
Check Point Blog
L
LangChain Blog

博客园 - netshuai

免安装Oracle客户端使用PL/SQL连接Oracle的2种方法 优化MyEclipse7.5 WebService大讲堂之Axis2(9):编写Axis2模块(Module) WebService大讲堂之Axis2(10):使用soapmonitor模块监视soap请求与响应消息 WebService大讲堂之Axis2(7):将Spring的装配JavaBean发布成WebService WebService大讲堂之Axis2(8):异步调用WebService WebService大讲堂之Axis2(5):会话(Session)管理 WebService大讲堂之Axis2(6):跨服务会话(Session)管理 WebService大讲堂之Axis2(4):二进制文件传输 WebService大讲堂之Axis2(3):使用services.xml文件发布WebService WebService大讲堂之Axis2(2):复合类型数据的传递 (转)WebService大讲堂之Axis2(1):用POJO实现0配置的WebService J2EE项目代码编写规范 Dom4j入门 编码 GBK 的不可映射字符 ognl表达式用法笔记 - netshuai - 博客园 struts2中减少action数量(通配符使用) struts2校验框架之Visitor校验器 加快MyEclipse启动速度
struts2.1.6 datetimepicker标签不能使用的问题解决
netshuai · 2009-08-04 · via 博客园 - netshuai

在以前的struts2版本中datetimepicker只需要在head标签处设置
<s:head />,
就可以直接使用s:datetimepicker的标签了。
而在2.1.6版本中不能直接这样使用了,将datetimepicker移除了。
原因是此标签调用了dojo的datetimepicker的库。
所以现在使用的时候首先要导入一个库。

  • struts2-dojo-plugin-2.1.6.jar。


然后还要设置dojo的taglib

  1. <%@ taglib prefix="sd" uri="/struts-dojo-tags" %>   

同样也需要对theme进行设置

  1. <s:head theme="xhtml"/>   
  2. <sd:head parseContent="true"/>  

上面的设置在head标签中。
然后使用sd:datetimepocker就可以实现了。

设置formatLength为long的datetimepicker标签 value="today"默认显示当前日期,若想显示其他日期格式为value="%{'2009-1-1'}"

  1. <sd:datetimepicker toggleType="explode" value="today" formatLength="long" />  

设置displayFormat参数为“yyyy年MM月dd日”
displayWeeks参数为2的datetimepicker标签

  1. <sd:datetimepicker displayFormat="yyyy年MM月dd日" displayWeeks="2" />  

设置weekStartsOn参数为1,toggleType参数为fade的datetimepicker标签

  1. <sd:datetimepicker weekStartsOn="1" toggleType="fade" />  

设置显示时间datetimepicker标签

  1. <sd:datetimepicker type="time" value="8:30" />