当前位置: 代码迷 >> Web前端 >> No tag "datetimepicker" defined in tag library imported with prefix "s"
  详细解决方案

No tag "datetimepicker" defined in tag library imported with prefix "s"

热度:621   发布时间:2012-09-11 10:49:03.0
No tag "datetimepicker" defined in tag library imported with prefix "s"
No tag "datetimepicker" defined in tag library imported with prefix "s" 

原因:struts2.1.6 把struts2.0中的和ajax相关的,如datetimepicker,tree,treenode 都移动到了dojo中了

解决方法:

1.项目中引入struts2-dojo-plugin-2.1.6.jar。
2.jsp中加入如下内容 
<%@ page language="java" pageEncoding="UTF-8"%> 
<%@ taglib prefix="s" uri="/ struts-tags" %> 
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
3.<head>中加入下列 
<head> 
  <s:head theme="xhtml"/> 
  <sx:head parseContent="true"/>  
</head> 
4.页面中使用<sx:datetimepicker name="birthday" value="%{date}" displayFormat="yy-MM-dd" />
  相关解决方案