java日期格式化问题 <html:checkbox>

最近老是碰到个日期格式:

Date date =new Date();  

System.out.println(date);

 

Sun Jun 16 10:20:10 CST 2013

 

转化为我们的正常格式用SimpleDateFormat:

Date date =new Date();   
SimpleDateFormat k = new SimpleDateFormat("yyyy-MM-dd");
String kk = k.format(date);
System.out.println(kk);

 

 

2013-06-16

 

 

<html:checkbox property="checkPrintAll" styleId="checkPrintAll" value="false"></html:checkbox><!--  默認un check -->

打钩后台获取到true;否则获取到false;
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HTML表单实验 - 学生信息采集</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; } body { background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c); background-size: 400% 400%; animation: gradientBG 15s ease infinite; color: #333; min-height: 100vh; padding: 20px; display: flex; justify-content: center; align-items: center; } @keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } .container { max-width: 1000px; width: 100%; margin: 0 auto; } header { text-align: center; margin-bottom: 30px; padding: 20px; background: rgba(255, 255, 255, 0.9); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); } h1 { color: #1a2a6c; font-size: 2.5rem; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); } .subtitle { color: #b21f1f; font-size: 1.2rem; margin-bottom: 15px; } .experiment-info { display: flex; justify-content: center; gap: 30px; margin-top: 15px; flex-wrap: wrap; } .info-card { background: linear-gradient(135deg, #1a2a6c, #3a7bd5); color: white; padding: 15px 25px; border-radius: 8px; text-align: center; min-width: 200px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); } .info-card h3 { margin-bottom: 8px; font-size: 1.2rem; } .form-container { background: rgba(255, 255, 255, 0.95); border-radius: 15px; padding: 30px; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3); } h2 { text-align: center; color: #1a2a6c; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px solid #b21f1f; } table { width: 100%; border-collapse: collapse; margin-bottom: 25px; } th { background: #1a2a6c; color: white; padding: 12px; text-align: left; width: 30%; } td { padding: 12px; background: rgba(240, 240, 245, 0.7); } tr:nth-child(even) td { background: rgba(230, 230, 240, 0.7); } input, select, textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; transition: all 0.3s; } input:focus, select:focus, textarea:focus { outline: none; border-color: #3a7bd5; box-shadow: 0 0 8px rgba(58, 123, 213, 0.5); } .radio-group, .checkbox-group { display: flex; gap: 20px; flex-wrap: wrap; } .radio-option, .checkbox-option { display: flex; align-items: center; gap: 6px; } .form-buttons { display: flex; justify-content: center; gap: 20px; margin-top: 20px; } button { padding: 14px 35px; border: none; border-radius: 50px; font-size: 18px; font-weight: bold; cursor: pointer; transition: all 0.3s; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); } .submit-btn { background: linear-gradient(to right, #1a2a6c, #3a7bd5); color: white; } .reset-btn { background: linear-gradient(to right, #b21f1f, #e74c3c); color: white; } button:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); } button:active { transform: translateY(1px); } .requirements { background: rgba(26, 42, 108, 0.1); padding: 20px; border-radius: 10px; margin-top: 30px; } .requirements h3 { color: #1a2a6c; margin-bottom: 15px; text-align: center; } .requirements-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; } .requirement-item { background: rgba(255, 255, 255, 0.8); padding: 15px; border-radius: 8px; display: flex; align-items: center; gap: 10px; } .requirement-item i { background: #1a2a6c; color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; } footer { text-align: center; margin-top: 30px; color: rgba(255, 255, 255, 0.9); font-size: 0.9rem; } @media (max-width: 768px) { th, td { display: block; width: 100%; } th { margin-top: 15px; border-radius: 6px 6px 0 0; } .form-buttons { flex-direction: column; } } </style> </head> <body> <div class="container"> <header> <h1>HTML 语言实验</h1> <p class="subtitle">表单设计与实现 - 学生信息采集系统</p> <div class="experiment-info"> <div class="info-card"> <h3>实验目的</h3> <p>掌握利用HTML语言编写表单的能力</p> </div> <div class="info-card"> <h3>实验课时</h3> <p>2 学时</p> </div> <div class="info-card"> <h3>实验要求</h3> <p>表格布局 · 6个以上元素 · 5种表单控件</p> </div> </div> </header> <div class="form-container"> <h2>学生基本信息登记表</h2> <form action="#" method="post"> <table> <tr> <th><label for="name">姓名</label></th> <td><input type="text" id="name" name="name" required placeholder="请输入您的姓名"></td> </tr> <tr> <th><label for="student-id">学号</label></th> <td><input type="text" id="student-id" name="student_id" required placeholder="请输入您的学号"></td> </tr> <tr> <th><label for="email">电子邮箱</label></th> <td><input type="email" id="email" name="email" required placeholder="example@university.edu.cn"></td> </tr> <tr> <th><label for="password">密码</label></th> <td><input type="password" id="password" name="password" required placeholder="设置登录密码"></td> </tr> <tr> <th><label>性别</label></th> <td> <div class="radio-group"> <div class="radio-option"> <input type="radio" id="male" name="gender" value="male"> <label for="male">男</label> </div> <div class="radio-option"> <input type="radio" id="female" name="gender" value="female"> <label for="female">女</label> </div> <div class="radio-option"> <input type="radio" id="other" name="gender" value="other"> <label for="other">其他</label> </div> </div> </td> </tr> <tr> <th><label for="birthdate">出生日期</label></th> <td><input type="date" id="birthdate" name="birthdate"></td> </tr> <tr> <th><label for="college">所属学院</label></th> <td> <select id="college" name="college"> <option value="">-- 请选择学院 --</option> <option value="computer">计算机科学与技术学院</option> <option value="electronic">电子信息工程学院</option> <option value="mechanical">机械工程学院</option> <option value="business">商学院</option> <option value="art">艺术学院</option> <option value="science">理学院</option> </select> </td> </tr> <tr> <th><label>兴趣爱好</label></th> <td> <div class="checkbox-group"> <div class="checkbox-option"> <input type="checkbox" id="sports" name="interests" value="sports"> <label for="sports">体育运动</label> </div> <div class="checkbox-option"> <input type="checkbox" id="music" name="interests" value="music"> <label for="music">音乐</label> </div> <div class="checkbox-option"> <input type="checkbox" id="reading" name="interests" value="reading"> <label for="reading">阅读</label> </div> <div class="checkbox-option"> <input type="checkbox" id="travel" name="interests" value="travel"> <label for="travel">旅行</label> </div> </div> </td> </tr> <tr> <th><label for="bio">个人简介</label></th> <td> <textarea id="bio" name="bio" rows="4" placeholder="请简要介绍你自己..."></textarea> </td> </tr> <tr> <th><label>照片上传</label></th> <td><input type="file" id="photo" name="photo" accept="image/*"></td> </tr> </table> <div class="form-buttons"> <button type="submit" class="submit-btn">提交信息</button> <button type="reset" class="reset-btn">重置表单</button> </div> </form> <div class="requirements"> <h3>实验要求实现情况</h3> <div class="requirements-list"> <div class="requirement-item"> <i>1</i> <div>使用表格进行表单布局 - <strong>已实现</strong></div> </div> <div class="requirement-item"> <i>2</i> <div>包含6个以上表单元素 - <strong>已实现(11个元素)</strong></div> </div> <div class="requirement-item"> <i>3</i> <div>使用5种以上表单控件 - <strong>已实现(7种控件)</strong></div> </div> <div class="requirement-item"> <i>4</i> <div>表单控件类型:文本输入、密码、单选、复选、下拉选择、文本域、文件上传、日期选择器</div> </div> </div> </div> </div> <footer> <p>HTML 语言实验报告 | 网页设计与开发 | © 2023 计算机科学与技术学院</p> </footer> </div> </body> </html>
05-30
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('用户列表')" /> <th:block th:include="include :: layout-latest-css" /> <th:block th:include="include :: ztree-css" /> </head> <body class="gray-bg"> <div class="ui-layout-west"> <div class="box box-main"> <div class="box-header"> <div class="box-title"> <i class="fa icon-grid"></i> 组织机构 </div> <div class="box-tools pull-right"> <a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="管理部门"><i class="fa fa-edit"></i></a> <button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display: none;"> <i class="fa fa-chevron-up"></i> </button> <button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"> <i class="fa fa-chevron-down"></i> </button> <button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"> <i class="fa fa-refresh"></i> </button> </div> </div> <div class="ui-layout-content"> <div id="tree" class="ztree"></div> </div> </div> </div> <div class="ui-layout-center"> <div class="container-div"> <div class="row"> <div class="ibox-content"> <form id="formId"> <input type="hidden" id="parentId" name="parentId"> </form> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" aria-expanded="true" onclick="querylocationList()">功能位置列表</a></li> <li><a data-toggle="tab" aria-expanded="false" onclick="location_equitment()">关联设备</a></li> <li><a data-toggle="tab" aria-expanded="false" onclick="location_history()">安装历史</a></li> </ul> </div> <div class="btn-group-sm" id="toolbar" role="group"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:location:add"> <i class="fa fa-plus"></i> 添加 </a> <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:location:edit"> <i class="fa fa-edit"></i> 修改 </a> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:location:remove"> <i class="fa fa-remove"></i> 删除 </a> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:location:export"> <i class="fa fa-download"></i> 导出 </a> </div> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <th:block th:include="include :: layout-latest-js" /> <th:block th:include="include :: ztree-js" /> <script th:inline="javascript"> var addFlag = [[${@permission.hasPermi('system:location:add')}]]; var editFlag = [[${@permission.hasPermi('system:location:edit')}]]; var removeFlag = [[${@permission.hasPermi('system:location:remove')}]]; var prefix = ctx + "system/location"; $(function() { var panehHidden = false; if ($(this).width() < 769) { panehHidden = true; } $('body').layout({ initClosed: panehHidden, west__size: 185 }); querylocationList(); queryLocationTree(); }); var ButtonManager = { templates: { location: ` <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:location:add"> <i class="fa fa-plus"></i> 添加 </a> <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:location:edit"> <i class="fa fa-edit"></i> 修改 </a> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:location:remove"> <i class="fa fa-remove"></i> 删除 </a> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:location:export"> <i class="fa fa-download"></i> 导出 </a> `, equit: ` <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:base:add"> <i class="fa fa-plus"></i> 添加 </a> <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:base:edit"> <i class="fa fa-edit"></i> 修改 </a> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:base:remove"> <i class="fa fa-remove"></i> 删除 </a> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:base:export"> <i class="fa fa-download"></i> 导出 </a> `, history: ` <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:location:export"> <i class="fa fa-download"></i> 导出 </a> ` }, change: function(buttonType) { if (this.templates[buttonType]) { $('#toolbar').html(this.templates[buttonType]); return true; } return false; }, // 切换到安装位置按钮 toLocation: function() { return this.change('location'); }, // 切换到关联设备按钮 toEquit: function() { return this.change('equit'); }, // 切换到安装历史按钮 toHistory: function() { return this.change('history'); } }; function location_equitment(){ prefix = ctx + "system/base"; debugger; var options2 = { id:'bootstrap-table', url: prefix + "/list", createUrl: prefix + "/add", updateUrl: prefix + "/edit/{id}", removeUrl: prefix + "/remove", exportUrl: prefix + "/export", modalName: "设备基础信息", columns: [{ checkbox: true }, { field: 'devId', title: '设备ID', visible: false }, { field: 'devCode', title: '设备编码' }, { field: 'devName', title: '设备名称' }, { field: 'professionName', title: '专业名称' }, { field: 'devSpecksId', title: '设备型号' }, { field: 'measurementFlag', title: '计量标志' }, { field: 'maintenanceFlag', title: '养护标志' }, { field: 'devStatus', title: '设备状态' }, { field: 'statuDate', title: '当前状态日期' }, { field: 'userDevFlag', title: '是否用户设备' }, { field: 'factory', title: '生产厂家' }, { field: 'zclb', title: '管理分类' }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.devId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.devId + '\')"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; debugger; reinitializeTable(options2); //$.table.init(options2); ButtonManager.toEquit(); // 切换回新增按钮 $.table.search(); } function location_history(){ ButtonManager.toHistory(); } //销毁table function reinitializeTable(newOptions) { var tableId = 'bootstrap-table'; // 你的表格ID // 方法1:销毁后重新初始化 try { // 销毁现有表格 $('#' + tableId).bootstrapTable('destroy'); } catch (e) { console.log('表格销毁失败或表格不存在:', e); } // 清空表格容器(可选) $('#' + tableId).empty(); // 重新初始化 $.table.init(newOptions || options); } function querylocationList() { prefix = ctx + "system/location"; var options = { url: prefix + "/list", createUrl: prefix + "/add", updateUrl: prefix + "/edit/{id}", removeUrl: prefix + "/remove", exportUrl: prefix + "/export", modalName: "设备位置管理", columns: [{ checkbox: true }, { field: 'locationId', title: '部门主键seq_gk_equipment_type', visible: false }, { field: 'parentId', title: '上级功能位置编码' }, { field: 'locationName', title: '功能位置名称' }, { field: 'status', title: '使用标志' }, { field: 'repairdept', title: '维护计划部门' }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.locationId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.locationId + '\')"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); ButtonManager.toLocation(); } function queryHistoryList() { var options = { url: prefix + "/list", createUrl: prefix + "/add", updateUrl: prefix + "/edit/{id}", removeUrl: prefix + "/remove", exportUrl: prefix + "/export", modalName: "安装历史", columns: [{ checkbox: true }, { field: 'locationId', title: '部门主键seq_gk_equipment_type', visible: false }, { field: 'parentId', title: '父层级id' }, { field: 'locationName', title: '设备类型名称' }, { field: 'status', title: '设备类型状态' }, { field: 'repairdept', title: '维护部门' }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.locationId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.locationId + '\')"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); $.table.search(); } function queryLocationTree() { var url = ctx + "system/location/treeData"; var options = { url: url, expandLevel: 2, onClick : zOnClick }; $.tree.init(options); function zOnClick(event, treeId, treeNode) { $("#parentId").val(treeNode.id); $.table.search(); } } $('#btnExpand').click(function() { $._tree.expandAll(true); $(this).hide(); $('#btnCollapse').show(); }); $('#btnCollapse').click(function() { $._tree.expandAll(false); $(this).hide(); $('#btnExpand').show(); }); $('#btnRefresh').click(function() { queryLocationTree(); }); /* 用户管理-部门 */ function dept() { var url = ctx + "system/type"; $.modal.openTab("设备类型管理", url); } </script> </body> <!-- 导入区域 --> <script id="importTpl" type="text/template"> <form enctype="multipart/form-data" class="mt20 mb10"> <div class="col-xs-offset-1"> <input type="file" id="file" name="file"/> <div class="mt10 pt5"> <input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据   <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a> </div> <font color="red" class="pull-left mt10"> 提示:仅允许导入“xls”或“xlsx”格式文件! </font> </div> </form> </script> </html>不同的tab页添加不同的查询条件
最新发布
11-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值