使用struts2中的datetimepicker标签

 1: 必须在jsp页面中的head标签中加入:<s:head/>

       例: <head>
                        <title>Sign On</title>
                        <s:head/>
              </head>

2:在web.xml中加入如下url pattern:

     <filter>
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>

    <filter-mapping>
           <filter-name>struts2</filter-name>
           <url-pattern>/*</url-pattern>
    </filter-mapping>

 

    注意:一定要加入<url-pattern>/*</url-pattern>,若不会出现dojo is not defined错误,开始我就有这个错。

 

3:在jsp页面中使用datetimepicker标签:

     <s:datetimepicker name="birthday" label="Birthday" displayFormat="yyyy-MM-dd">                                

 

     </s:datetimepicker>

 

你可能感兴趣的:(jsp,struts,filter,url,dojo)