今天使用Struts-2.2.1 中Struts标签的时候出现下面错误
No tag "datetimepicker" defined in tag library imported with prefix "s"
这个错误主要是由于原因:
struts2.1.6 把struts2.0中的和ajax相关的,如datetimepicker,tree,treenode 都移动到了dojo中了
解决方法如下:
1.jsp中加入如下内容
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
2.<head>中加入下列
<head>
<s:head />
<sx:head />
</head>
3.页面中使用
<sx:datetimepicker name="birthday" label="生日:" displayFormat="yyyy-MM-dd"></sx:datetimepicker>
4.项目中引入struts2-dojo-plugin-2.2.1.1.jar 放在/web-inf/lib下。
本文转自 w156445045 51CTO博客,原文链接:http://blog.51cto.com/enetq/536790,如需转载请自行联系原作者