經歷了四個月的學習,中間過程曲折離奇,好在堅持下來了,也到了最後框架的整合中間過程也只有本身能體會了。javascript
接下來開始說一下整合中的問題和技巧:css
1, jar包導入html
c3p0(2個)、jdbc(1個)、spring(15個)、Hibernate(10個)、Struts2(13個)、json(3個)java
及EasyUI的jquery包
jquery
2, 在src目錄下新建一個實體類的包,並新建一個實體類web
package com.han.entity; import java.util.Date; public class Student { private String sno ; private String sname ; private String ssex ; private Date sbirthday ; private String sclass ; /*省略set、get方法*/ }
3, 生成hibernate.cfg.xml的文件,並生成實體類的 Student.hbm.xmlspring
值得提的是cfg.xml中並不須要鏈接數據庫的驅動、用戶名、用戶密碼及文件的映射,由於在spring中咱們會添加這些配置 sql
4, 這裏咱們用的是鏈接池鏈接數據庫數據庫
db.properties的配置(放在src下面):apache
5, 接下來咱們在app.xml配置中聲明事務及事務的切點
6, 咱們建以下包,並分別在對應包中建新的接口和實現類
7, 接下來咱們開始Struts2的配置
這裏要注意的是Action的name這裏要與網頁中發送地址對應,class對應的則是aap.xml中的id名,這裏整合spring的話class不能寫類的限定名,否則會有空指針異常,method就是Action這個類中的方法名
8, 這裏整合spring因此咱們都定義了接口及其實現類
9, 在service層中咱們定義了一個dao接口的實例化做爲屬性,並設置了set方法
10, 到這裏基本的環境搭建就完成了
下面是每一個層的具體方法:
dao層接口
package com.hanqi.dao; import java.util.List; import java.util.Map; import com.han.entity.Student; public interface StudentDAO { //獲取分頁數據集合 List<Student> find(int page, int rows, String sort, Map<String, String> map) ; //獲取數據條數 int findTotal(Map<String, String> map) ; //添加數據 void add(Student stu) ; }
dao層接口的實現類impl
package com.hanqi.dao.impl; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.hibernate.Query; import org.hibernate.SessionFactory; import com.han.entity.Student; import com.hanqi.dao.StudentDAO; public class StudentDAOImpl implements StudentDAO { private SessionFactory sessionFactory ; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } @Override public List<Student> find(int page, int rows, String sort, Map<String, String> map) { List<Student> list = new ArrayList<>() ;//定義list變量並實例化 String sql = "from Student where 1=1 " ; //建立基礎HQL語句 String snames = map.get("snames") ;//接收參數 if(snames != null && !snames.equals(""))//判斷參數 { sql += "and sname =:snames " ;// } String sclasss = map.get("sclasss") ; if(sclasss != null && !sclasss.equals("")) { sql += "and sclass =:sclasss " ; } if(sort != null && !sort.equals("")) { sql += "order by " + sort ; } Query qu = sessionFactory.getCurrentSession().createQuery(sql) ; if(snames != null && !snames.equals("")) { qu.setString("snames", snames) ; } if(sclasss != null && !sclasss.equals("")) { qu.setString("sclasss", sclasss) ; } //System.out.println(sql); list = qu.setMaxResults(rows)//每頁行數 .setFirstResult((page-1)*rows)//起始頁碼 .list() ; return list ; } @Override public int findTotal(Map<String, String> map) { int rtn = 0 ;//定義變量並賦值 String sql = "select count(1) from Student where 1=1 " ; String snames = map.get("snames") ;//接收參數 if(snames != null && !snames.equals(""))//判斷參數 { sql += "and sname =:snames " ;// } String sclasss = map.get("sclasss") ; if(sclasss != null && !sclasss.equals("")) { sql += "and sclass =:sclasss " ; } Query qu = sessionFactory.getCurrentSession().createQuery(sql) ; //獲取Query對象 if(snames != null && !snames.equals("")) { qu.setString("snames", snames) ; } if(sclasss != null && !sclasss.equals("")) { qu.setString("sclasss", sclasss) ; } List<Object> list = qu.list() ;//定義list變量並實例化 if(list != null && list.size() > 0 )//判斷獲取的集合非空及長度 { rtn = Integer.parseInt(list.get(0).toString()) ;//給變量rtn賦值 } return rtn ;//返回變量值 } @Override public void add(Student stu) { sessionFactory.getCurrentSession().save(stu) ; } }
service層接口
package com.hanqi.service; import java.util.List; import java.util.Map; import com.han.entity.Student; public interface StudentService { //獲取分頁數據集合 public List<Student> getList(int page, int rows, String sort, Map<String, String> map) ; //獲取數據條數 int getTotal(Map<String, String> map) ; //查詢分頁數據,並返回JSON String getPageJSON(int page, int rows, String sort, Map<String, String> map) ; //添加數據 void insert(Student stu) ; }
service層接口的實現類impl
package com.hanqi.service.impl; import java.util.List; import java.util.Map; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hanqi.service.PageJSON; import com.han.entity.Student; import com.hanqi.dao.StudentDAO; import com.hanqi.service.StudentService; public class StudentServiceImpl implements StudentService { private StudentDAO studentDAO ; public void setStudentDAO(StudentDAO studentDAO) { this.studentDAO = studentDAO; } @Override public List<Student> getList(int page, int rows, String sort, Map<String, String> map) { return studentDAO.find(page, rows, sort, map) ; } @Override public int getTotal(Map<String, String> map) { return studentDAO.findTotal(map) ; } @Override public String getPageJSON(int page, int rows, String sort, Map<String, String> map) { PageJSON<Student> pj = new PageJSON<Student>() ; String rtn = "{\"total\":0,\"rows\":[ ]}" ;//轉義字符 int total = studentDAO.findTotal(map) ; if(total > 0) { List<Student> list = studentDAO.find(page, rows, sort, map) ; //將List集合轉爲JSON集合 String json_list = JSONArray.toJSONString(list) ; pj.setRows(list); pj.setTotal(total); rtn = JSONObject.toJSONString(pj) ; //轉義字符返回複合類型的JSON字符串 //rtn = "{\"total\":"+total+",\"rows\":"+json_list+"}" ; } return rtn ; } @Override public void insert(Student stu) { studentDAO.add(stu); } }
action類(這裏用的域模型來接受從頁面傳遞過來的參數,即直接定義名字相同的屬性值,並生成set、get方法)
package com.hanqi.action; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.ServletActionContext; import com.han.entity.Student; import com.hanqi.service.StudentService; public class StudentAction { private StudentService studentService ; public void setStudentService(StudentService studentService) { this.studentService = studentService; } public StudentService getStudentService() { return studentService; } private int page ; private int rows ; private String sort ; private String order ; private String snames ; private String sclasss ; @Override public String toString() { return "StudentAction [page=" + page + ", rows=" + rows + ", sort=" + sort + ", order=" + order + ", snames=" + snames + ", sclasss=" + sclasss + "]"; } public int getPage() { return page; } public void setPage(int page) { this.page = page; } public int getRows() { return rows; } public void setRows(int rows) { this.rows = rows; } public String getSort() { return sort; } public void setSort(String sort) { this.sort = sort; } public String getOrder() { return order; } public void setOrder(String order) { this.order = order; } public String getSnames() { return snames; } public void setSnames(String snames) { this.snames = snames; } public String getSclasss() { return sclasss; } public void setSclasss(String sclasss) { this.sclasss = sclasss; } public void getStudentList() { System.out.println(this); try{ //查詢參數 if(snames != null) { snames =new String(snames.getBytes("ISO-8859-1"),"UTF-8") ;//轉碼 } if(sclasss != null) { sclasss =new String(sclasss.getBytes("ISO-8859-1"),"UTF-8") ;//轉碼 } System.out.println("snames = "+ snames ); System.out.println("sclasss = " + sclasss ); Map<String, String> map = new HashMap<String, String>() ; map.put("snames", snames) ; map.put("sclasss", sclasss) ; // map.put("snames","劉四") ; // map.put("sclasss", "11111") ; String ls = "" ; System.out.println(order +"=" +sort); if(sort != null && order != null) { ls = sort + " " + order ; } String json_list = studentService.getPageJSON(page, rows, ls, map) ; //返回數據 //System.out.println("json = "+json_list); HttpServletResponse response = ServletActionContext.getResponse(); response.setCharacterEncoding("UTF-8"); response.getWriter().write(json_list) ; }catch(Exception e) { e.printStackTrace(); } } //接收參數 private String sno ; private String sname ; private String ssex ; private String sclass ; private String sbirthday ; public String getSno() { return sno; } public void setSno(String sno) { this.sno = sno; } public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname; } public String getSsex() { return ssex; } public void setSsex(String ssex) { this.ssex = ssex; } public String getSclass() { return sclass; } public void setSclass(String sclass) { this.sclass = sclass; } public String getSbirthday() { return sbirthday; } public void setSbirthday(String sbirthday) { this.sbirthday = sbirthday; } public void insert() throws IOException { if(sno != null ) { String msg ; try { Student stu = new Student(); stu.setSclass(sclass); stu.setSname(sname); stu.setSno(sno); stu.setSsex(ssex); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); stu.setSbirthday(sdf.parse(sbirthday)); studentService.insert(stu); msg = "{'success':true,'message':'保存成功'}" ; } catch(Exception e) { msg = "{'success':false,'message':'保存失敗'}"; System.out.println("yichanghaha"); } HttpServletResponse response = ServletActionContext.getResponse(); response.setCharacterEncoding("UTF-8"); response.getWriter().write(msg); } else { String msg = "{'success':false,'message':'訪問異常'}" ; HttpServletResponse response = ServletActionContext.getResponse(); response.setCharacterEncoding("UTF-8"); response.getWriter().write(msg); } } }
同時在上面的action數據往前臺html傳送時咱們爲了返回json格式的字符串更加的方便靈活,咱們定義了一個獲取json
字符串格式的泛型輔助類,代碼以下:
package com.hanqi.service; import java.util.ArrayList; import java.util.List; public class PageJSON<T> { private int total = 0 ; private List<T> rows = new ArrayList<T>() ; public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public List<T> getRows() { return rows; } public void setRows(List<T> rows) { this.rows = rows; } }
Struts.xml
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <!-- 容許調用靜態方法和靜態屬性 --> <constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant> <constant name="struts.action.extension" value="do,action,,"></constant> <package name="stu" extends="struts-default"> <action name="studentAction" class="studentAction" method="getStudentList"> <!-- name 對應的是網頁中的post/get請求 --> <!-- 這裏的class來源是spring配置中的id名 --> <!-- method 方法是Action這個類中的方法 --> </action> <action name="addstudentAction" class="studentAction" method="insert"> <!-- name 對應的是網頁中的post/get請求 --> <!-- 這裏的class來源是spring配置中的id名 --> <!-- method 方法是Action這個類中的方法 --> </action> </package> </struts>
app.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd"> <!-- 基於c3p0鏈接池的數據源 --> <!-- 加載外部配置文件 --> <context:property-placeholder location="classpath:db.properties"/> <!-- 鏈接池 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${jdbc.driver_class}"></property> <property name="jdbcUrl" value="${jdbc.url}"></property> <property name="user" value="${jdbc.username}"></property> <property name="password" value="${jdbc.password}"></property> <property name="initialPoolSize" value="${jdbc.initPoolSize}"></property> <property name="maxPoolSize" value="${jdbc.maxPoolSize}"></property> </bean> <!-- Hibernate 的 SessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <!-- 加載Hibernate的配置文件 --> <property name="configLocation" value="classpath:hibernate.cfg.xml"></property> <!-- 映射文件, 可使用*做爲通配符--> <property name="mappingLocations" value="classpath:com/han/entity/*.hbm.xml" ></property> </bean> <!-- bean --> <!-- DAO --> <bean id="studentDAOImpl" class="com.hanqi.dao.impl.StudentDAOImpl" p:sessionFactory-ref="sessionFactory"></bean> <!-- Service --> <bean id="studentServiceImpl" class="com.hanqi.service.impl.StudentServiceImpl" p:studentDAO-ref="studentDAOImpl"></bean> <!-- 配置Action --> <!-- Action 的實例不能是單例的 --> <bean id="studentAction" class="com.hanqi.action.StudentAction" scope="prototype" p:studentService-ref="studentServiceImpl"></bean> <!-- 聲明式事務 --> <!-- 1.事務管理器 和sessionFactory關聯 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <!-- 事務通知 --> <tx:advice id="adv" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="*"/><!-- 使用事務的方法 --> <tx:method name="get" read-only="true"/> <!-- get開頭的只讀方法,不使用事務 --> <tx:method name="find" read-only="true"/> <!-- find開頭的只讀方法,不使用事務 --> </tx:attributes> </tx:advice> <!-- 事務切點 --> <aop:config> <aop:advisor advice-ref="adv" pointcut="execution(* com.hanqi.service.*.*(..))"/> <!-- 接口 --> </aop:config> </beans>
Hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory > <!-- 數據庫方案--> <property name="hibernate.default_schema">TEST0816</property> <!-- 數據庫方言--> <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property> <!-- 調試--> <property name="hibernate.show_sql">true</property> <property name="hibernate.format_sql">true</property> <!-- 自動建表方式--> <property name="hibernate.hbm2ddl.auto">update</property> </session-factory> </hibernate-configuration>
web.xml(這裏同時還配置了過濾器要放在Struts配置以前)
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>Test41</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <!-- 過慮器 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 加載 Struts2 過濾器配置 --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 加載 spring 配置 --> <!-- needed for ContextLoaderListener --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:app.xml</param-value> </context-param> <!-- Bootstraps the root web application context before servlet initialization --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> </web-app>
html(在頁面的部分並無多大改動,只是提交的servlert變成了Struts2的action)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>77</title> <!-- 1 jQuery的js包 --> <script type="text/javascript" src="jquery-easyui-1.4.4/jquery.min.js"></script> <!-- 2 css資源 --> <link rel="stylesheet" type="text/css" href="jquery-easyui-1.4.4/themes/default/easyui.css"> <!-- 3 圖標資源 --> <link rel="stylesheet" type="text/css" href="jquery-easyui-1.4.4/themes/icon.css"> <!-- 4 EasyUI的js包 --> <script type="text/javascript" src="jquery-easyui-1.4.4/jquery.easyui.min.js"></script> <!-- 5 本地語言 --> <script type="text/javascript" src="jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script> </head> <body> <script type="text/javascript"> //把long型日期轉爲想要類型 function getDate(date) { //獲得日期對象 var d = new Date(date) ; //獲得年月日 var year = d.getFullYear() ; var month = (d.getMonth()+ 1) ; var day = d.getDate() ; //封裝 var tt = year+"-"+(month<10?"0"+month: month)+"-"+(day<10?"0"+day:day) ; return tt ; } //定義一個type變量,判斷修改添加操做 var type = "add" ; $(function(){ $('#dg').datagrid({ url:'studentAction.action', idField:'sno', frozenColumns:[ [ {field:'id',checkbox:true},//複選框 {field:'sno',title:'學號',width:100,align:'center'} ] ], columns:[[ {field:'sname',title:'姓名',width:100,align:'center'}, {field:'ssex',title:'性別',width:100,align:'center'}, {field:'sbirthday',title:'生日',width:100,align:'center', formatter:function(value, row, index){ if(value && value != "") { //var valuee = new Date(value).toLocaleDateString(); //return valuee; //調用function方法 return getDate(value) ; } else { return "" ; } }}, {field:'sclass',title:'班級',width:100,align:'center'} ]], pagination:true,//分頁 fitColumns:true,//列自適應寬度 rownumbers:true,//顯示行號 striped:true,//斑馬線 singleSelect:false,//是否單選 sortName:'sno',//排序字段 sortOrder:'desc',//排序方式 remoteSort:true,//服務器端排序 toolbar:[ {iconCls:'icon-reload',text:'刷新', handler:function(){ $("#dg").datagrid('reload');}}, {iconCls:'icon-search',text:'查詢', handler:function(){ //序列化查詢表單 var f = $("#form2").serialize() ; //alert(f) ; $("#dg").datagrid({url:"studentAction.action?"+f}); $("#form2").form("reset"); $("#dg").datagrid('reload'); }}, {iconCls:'icon-add',text:'添加', handler:function(){ $("#sno").textbox({readonly:false}); type = "add" ; //清除表單舊數據 $("#form1").form("reset"); $("#savestu").dialog('open').dialog('setTitle','New User'); }}, {iconCls:'icon-edit',text:'修改',handler:function(){ //alert("修改"); //設置主鍵字段爲只讀模式 $("#sno").textbox({readonly:true}); type = "edit" ; $("#form1").form("reset"); var rt = $("#dg").datagrid('getSelected'); //document.write(rt); if(rt) { $("#form1").form('load',{ sno:rt.sno, sname:rt.sname, sclass:rt.sclass, ssex:rt.ssex, sbirthday:getDate(rt.sbirthday) } ) ; $("#savestu").dialog('open').dialog('setTitle','Edit User'); } else { $.messager.show({title:"提示",msg:"請選中一條記錄"}); } // $("#editstu").dialog('open') ; }}, {iconCls:'icon-delete1',text:'單條刪除',handler:function(){ var rt = $("#dg").datagrid('getSelected'); if(rt) { $.messager.confirm('Confirm','Are you sure you want to destroy this user?', function(r){ if(r) { // alert(rt.sno); $.post('deleteServlet?sno='+rt.sno,function(result){var msg = eval('(' + result + ')') ; if(msg.success){$("#dg").datagrid('reload');alert(msg.message)}}); } })} else { $.messager.show({title:"提示",msg:"請選中一條記錄"}); } }}, {iconCls:'icon-delete1',text:'多條刪除',handler:function(){ var rt = $("#dg").datagrid('getSelections'); //保存選中記錄的主鍵 var arr = [] ; for(i in rt){ arr.push(rt[i].sno); } // alert(arr); if(rt.length>0) { $.messager.confirm('Confirm','Are you sure you want to destroy these users?', function(r){ if(r) { // alert(rt.sno); $.post('duoDeleteServlet?arr='+arr,function(result){var msg = eval('(' + result + ')') ; if(msg.success){$("#dg").datagrid('reload');$.messager.show({title:'消息',msg:msg.message})}}); } })} else { $.messager.show({title:"提示",msg:"請選中至少一條記錄"}); } }}] }); }) </script> <div id="search" class="easyui-panel" style="height:80px;width:100%" title="查詢條件" data-options="{iconCls:'icon-search',collapsible:true}"> <form action="" id="form2"><br> 姓名<input class="easyui-textbox" id="snames" name="snames"> 班級<input class="easyui-textbox" id="sclasss" name="sclasss"> </form> </div> <table id="dg"></table> <div id="savestu" class="easyui-dialog" style="width:400px;height:300px" data-options="closed:true, modal:true, buttons:[{text:'保存',iconCls:'icon-save',handler:function(){ $('#form1').form('submit',{ url :'addstudentAction.action?type=' +type, onSubmit:function(){ var isValid = $(this).form('validate'); if(!isValid){ $.messager.show({ title:'消息', msg:'提交未經過驗證'}); } return isValid ; }, success:function(data){ var msg = eval('(' + data + ')') ; if(msg.success) { $('#dg').datagrid('reload'); $('#savestu').dialog('close'); alert(msg.message); } else {alert(msg.message)}}}); }}, {text:'取消',iconCls:'icon-cancel',handler:function(){ $('#savestu').dialog('close');}}]"> <form action="" id="form1" method="post"> <table border="0" width="100%"> <br><br><br> <tr> <td align="right" width="30%" >學號</td> <td><input class="easyui-textbox" id="sno" name="sno" data-options="required:true,validType:'length[3,3]'"></td> </tr> <tr> <td align="right" width="30%">姓名</td> <td><input class="easyui-textbox" id="sname" name="sname" data-options="required:true,validType:'length[2,4]'"></td> </tr> <tr> <td align="right" width="30%">性別</td> <td><input type="radio" name="ssex" value="男" checked>男 <input type="radio" name="ssex" value="女">女</td> </tr> <tr> <td align="right" width="30%">班級</td> <td><input class="easyui-textbox" id="sclass" name="sclass" data-options="required:true,validType:'length[5,5]'"></td> </tr> <tr> <td align="right" width="30%">生日</td> <td><input class="easyui-datebox" id="sbirthday" name="sbirthday" data-options="required:false,showSeconds:true"></td> </tr> </table> </form> </div> </div> </body> </html>