zoukankan      html  css  js  c++  java
  • No tag "datetimepicker" defined in tag library imported with prefix "s"解决

    今天在学习Struts2标签中的datetimepicker出现这样一个exception:

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

    原因:

    struts2.3.8 把struts2中的和ajax相关的,如datetimepicker,tree,treenode都移动到了dojo中了

    解决方法:

    1.将struts2-dojo-plugin-2.3.8.jar拷贝到/web-inf/lib下

    2.jsp页面文件加入"<%@taglib prefix="sx" uri="/struts-dojo-tags"%>"

    3.在使用<s:datetimepicker>前添加<sx:head/>

    4.<s:datetimepicker>换成<sx:datetimepicker>


    <%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <%@taglib prefix="s" uri="/struts-tags" %>
    <%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>datetimepicker用法</title>
        
    	<meta http-equiv="pragma" content="no-cache">
    	<meta http-equiv="cache-control" content="no-cache">
    	<meta http-equiv="expires" content="0">    
    	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    	<meta http-equiv="description" content="This is my page">
    	<!--
    	<link rel="stylesheet" type="text/css" href="styles.css">
    	-->
      </head>
      
      <body>
      	<sx:head />
        <s:form>
        	出生日期:
        	<sx:datetimepicker name="mydate" toggleType="explode"
        		value="today" type="date" language="zh_CN" />
        </s:form>
      </body>
    </html>


  • 相关阅读:
    javascript 原型和构造函数
    react native与原生的交互
    项目中git的用法
    web页面的回流,认识与避免
    js 中的算法题,那些经常看到的
    js中this的四种调用模式
    JS面向对象的几种写法
    模块化加载require.js
    es6新语法
    vue组件化开发
  • 原文地址:https://www.cnblogs.com/tgxblue/p/4217346.html
Copyright © 2011-2022 走看看