---
title: "No tag \"datetimepicker\" defined in tag library imported with prefix \"s\""
author: "ottoliu"
date: "2011-04-13T16:49:43Z"
tags: []
categories: ["企业架构"]
slug: "no-tag-datetimepicker-defined-in-tag-library-imported-with-prefix-s"
draft: false
lastmod: "2011-04-13T16:49:43Z"
id: 1001892
url: "https://ottoliu.iteye.com/blog/1001892"
---

<span style="color:red">错误提示</span>：org.apache.jasper.JasperException: /struts2/index.jsp(16,3) No tag "datetimepicker" defined in tag library imported with prefix "s" 

<span style="color:red">出错的原因</span>：struts2.1.6 把struts2.0中的和ajax相关的，如datetimepicker，tree，treenode 都移动到了dojo中了 
<span style="color:red">
解决方法</span>： 

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" />