今天使用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下。