- 浏览: 666988 次
- 性别:
- 来自: 长沙
文章分类
- 全部博客 (364)
- quick start (57)
- bboss aop (43)
- bboss mvc (48)
- bboss persistent (96)
- bboss taglib (30)
- bboss event (10)
- bbossgroups (52)
- bboss (32)
- bboss会话共享 (17)
- bboss rpc (7)
- bboss 国际化 (5)
- bboss 序列化 (9)
- bboss cxf webservice (8)
- bboss hessian (3)
- bboss 安全认证SSO (15)
- bboss 工作流 (6)
- 平台 (18)
- bboss quartz (3)
- 杂谈 (5)
- 大数据 (1)
- bboss elastic (24)
- bboss http (1)
- bboss kafka (1)
- Elasticsearch Scroll和Slice Scroll查询API使用案例 (1)
最新评论
-
qianhao123:
...
采用gradle构建和发布bboss方法介绍 -
qianhao123:
[img][/img]
采用gradle构建和发布bboss方法介绍 -
yin_bp:
欢迎大家参与working
高性能elasticsearch ORM开发库使用介绍 -
qq641879434:
万分感谢
bboss 持久层sql xml配置文件编写和加载方法介绍 -
yin_bp:
qq641879434 写道怎么设置配置文件 可以查看执行的S ...
bboss 持久层sql xml配置文件编写和加载方法介绍
bboss mvc框架中使用注解指定控制器方法日期类型参数日期格式的例子
直入正题:
1.控制器方法定义-DateConvertController
2.选择日期的jsp页面
3.转换结果查看页面-ok.jsp
4.mvc框架配置文件-bboss-dateconvert.xml:
补充说明:如果不指定dateformat属性,那么将用yyyy-MM-dd HH:mm:ss作为默认的日期转换格式。
更详细的情况请参考bbossgroups 项目的mvcdemo应用相关文档《bbossgroups 3.1 mvc demo部署方法》:
http://yin-bp.iteye.com/blog/1026245
demo部署好后可以通过以下地址访问日期格式转换的例子:
http://localhost:8080/bboss-mvc/dateconvert/dateconvert.html
直入正题:
1.控制器方法定义-DateConvertController
/* * Copyright 2008 biaoping.yin * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.frameworkset.web.date; import org.frameworkset.util.annotations.RequestParam; import org.frameworkset.web.servlet.ModelMap; /** * <p>Title: DateConvertController.java</p> * <p>Description: 日期转换实例</p> * <p>bboss workgroup</p> * <p>Copyright (c) 2008</p> * @Date 2011-4-30 * @author biaoping.yin * @version 1.0 */ public class DateConvertController { public String converStringToDate(@RequestParam(name="d12",dateformat="yyyy-MM-dd") java.util.Date d12, @RequestParam(name="stringdate",dateformat="yyyy-MM-dd") java.sql.Date stringdate, @RequestParam(name="stringdatetimestamp",dateformat="yyyy-MM-dd HH/mm/ss") java.sql.Timestamp stringdatetimestamp, @RequestParam(name="stringdatetimestamp") String stringdatetimestamp_, ModelMap model) { model.put("java.util.Date", d12); model.put("java.sql.Date", stringdate); model.put("java.sql.Timestamp", stringdatetimestamp); return "path:convertok"; } public String dateconvert() { return "path:convertin"; } }
2.选择日期的jsp页面
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>DatePicker</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"> <script type="text/javascript" src="${pageContext.request.contextPath}/jsp/datepicker/My97DatePicker/WdatePicker.js"></script> <link rel="shortcut icon" href="${pageContext.request.contextPath}/css/favicon.gif"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/tables.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/main.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/mainnav.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/messages.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/tooltip.css" type="text/css"> </head> <body> <h1>日期格式转换demo</h1> <form action="converStringToDate.html" method="post"> <table class="genericTbl"> <tr> <th class="order1 sorted" >demo描述 </th> <th class="order1 sorted">演示区 </th> </tr> <tr class="even" > <td align="right"> 普通触发: </td> <td> <input id="d12" name="d12" type="text" onclick="WdatePicker({el:'d12'})" src="${pageContext.request.contextPath}/jsp/datepicker/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle"/> </td> </tr> <tr class="even"> <td align="right"> 精确到日期: </td> <td> <input class="Wdate" type="text" name="stringdate" onClick="WdatePicker()"> </td> </tr> <tr class="even"> <td align="right"> 精确具体时间: </td> <td> <input class="Wdate" type="text" name="stringdatetimestamp" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH/mm/ss'})"> </td> </tr> <tr class="even"> <td align="right"> 提交: </td> <td> <input type="submit" value="提交转换"/> </td> </tr> </table> </form> </body> </html>
3.转换结果查看页面-ok.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>DatePicker</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"> --> <script type="text/javascript" src="${pageContext.request.contextPath}/jsp/datepicker/My97DatePicker/WdatePicker.js"></script> <link rel="shortcut icon" href="${pageContext.request.contextPath}/css/favicon.gif"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/tables.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/main.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/mainnav.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/messages.css" type="text/css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/css/classic/tooltip.css" type="text/css"> </head> <body> <h1>日期格式转换demo转换结果</h1> <form action="dateconvert.html" method="post"> <table class="genericTbl"> <tr> <th class="order1 sorted" >demo描述 </th> <th class="order1 sorted">演示区 </th> </tr> <tr class="even" > <td align="right"> 普通触发: </td> <td> <%=request.getAttribute("java.util.Date") %> </td> </tr> <tr class="even"> <td align="right"> 精确到日期: </td> <td> <%=request.getAttribute("java.sql.Date") %> </td> </tr> <tr class="even"> <td align="right"> 精确具体时间: </td> <td> <%=request.getAttribute("java.sql.Timestamp") %> </td> </tr> <tr class="even"> <td align="right"> 返回: </td> <td> <input type="submit" value="返回"/> </td> </tr> </table> </form> </body> </html>
4.mvc框架配置文件-bboss-dateconvert.xml:
<?xml version="1.0" encoding='gb2312'?> <!-- bboss-dateconvert.xml 描述:日期类型转换 --> <properties> <property name="/dateconvert/*.html" path:convertok="/dateconvert/ok" path:convertin="/dateconvert/in" class="org.frameworkset.web.date.DateConvertController"/> </properties>
补充说明:如果不指定dateformat属性,那么将用yyyy-MM-dd HH:mm:ss作为默认的日期转换格式。
更详细的情况请参考bbossgroups 项目的mvcdemo应用相关文档《bbossgroups 3.1 mvc demo部署方法》:
http://yin-bp.iteye.com/blog/1026245
demo部署好后可以通过以下地址访问日期格式转换的例子:
http://localhost:8080/bboss-mvc/dateconvert/dateconvert.html
发表评论
-
bboss离线开发文档下载
2013-05-14 18:08 1777bboss离线开发文档下载 为了便于bboss开发人员离线查找 ... -
bboss 3.6发布,丰富的功能扩展和改进
2012-10-07 09:50 1937bboss 3.6 (官网下载,sf下载)发布了,新版本相比之 ... -
Bboss国际化实践PPT
2012-06-10 12:52 1259Bboss国际化实践PPT,点击链接即可下载: Bboss国际 ... -
bboss国际化功能简介
2012-05-09 08:59 1161借助bboss国际化功能,我们可以非常方便快捷地实现系统 ... -
bboss 4.10.7及更低版本ant构建方法
2012-03-23 22:54 5836本文适用bboss 4.10.7及更低版本,4.10.8及后续 ... -
bboss 将内容为GBK编码文件转UTF-8工具介绍
2012-03-23 15:53 1612bboss 将内容为GBK编码文件转UTF-8工具介绍 bb ... -
bbossgroups 3.5 发布
2012-02-18 14:51 1101版本:bbossgroups-3.5 官网:http://w ... -
bboss 序列化功能详解
2012-01-27 11:04 1571bboss 序列化功能详解,bboss序列化组件是bbossg ... -
bboss 序列化机制重大改进-支持复杂对象及对象之间关系序列化和恢复功能
2012-01-09 23:19 1311bboss 序列化机制重大改进-支持复杂对象及对象之间关系序列 ... -
bbossgroups 3.4发布
2011-10-26 22:45 1067版本: bbossgroups-3.4 bboss gro ... -
bbossgroups 对象xml序列化/反序列化性能测试
2011-10-10 23:16 1297本文探讨开源项目bbossgroups 中对象xml序列化/反 ... -
bbossgroups 开发系列文章之一 最佳实践
2011-10-01 12:50 1371bbossgroups 开发系列文章之-最佳实践 一、概述 ... -
bboss 组件容器的使用方法浅析
2011-08-20 00:21 1564本文重点介绍bboss 中的4大组件容器的特点及使用方法 4 ... -
bbossgroups 3.3 发布
2011-08-19 23:02 1025bbossgroups 3.3 发布,该版本在3.2的基础上做 ... -
bbossgroups框架发布的jar包和依赖jar包概览
2011-08-09 23:16 1926bbossgroups框架发布的jar包和依赖jar包概览 j ... -
我们需要一站式解决方案还是混合组合方案
2011-08-05 14:10 1106这年头提供一站式解决方案的框架才具备真正的核心竞 ... -
bbossgroups的特色特点介绍
2011-07-10 10:49 1380很多朋友都在问bbossgroups框架和其他mvc框架 、s ... -
bbossgroups 相关资料整理
2011-06-24 08:13 1080为了方便大家了解bbossgroups,我特意把相关的资料整理 ... -
bbossgroups项目demo站点升级完毕,朋友们可以去看看
2011-06-19 22:52 1127bbossgroups项目demo站点升级完毕,访问地址: h ... -
开源项目bbossgroups,诚邀有志之士加盟
2011-06-15 10:03 537国内新兴的j2ee开源项目bbossgroups,诚邀有志之士 ...
相关推荐
NULL 博文链接:https://yin-bp.iteye.com/blog/926166
NULL 博文链接:https://yin-bp.iteye.com/blog/1131637
企业级 J2EE 开源框架:bboss
NULL 博文链接:https://yin-bp.iteye.com/blog/1528721
NULL 博文链接:https://yin-bp.iteye.com/blog/2174863
bboss是一个j2ee开源框架,为企业级应用开发提供一站式解决方案,并能有效地支撑移动应用开发。bboss功能涵盖ioc,mvc,jsp自定义标签库,持久层,全局事务托管,安全认证,SSO,web会话共享,cxfwebservice服务发布...
官方版本,亲测可用
bboss会话共享培训文档,学习bboss不可多得的资料,值得拥有。
NULL 博文链接:https://yin-bp.iteye.com/blog/1449900
bboss es特点请访问: https://www.oschina.net/p/bboss-elastic
自动代码生成器是针对bboss框架和bboss开发平台的自动代码生成工具,可以根据模板,自动生成给定表的增,删,改,分页查询,列表查询,国际化功能对应的程序和配置文件: 1.mvc控制器 2.业务组件 3.实体类 4.jsp文件...
bboss+es基本操作示例,elasticsearch,bboss,java使用demo
NULL 博文链接:https://yin-bp.iteye.com/blog/2325602
官方版本,亲测可用
springboot集成ElasticsearchBboss调用Elasticsearch的案例分享
Elasticsearch rest client bboss介绍-Elastic2018中国开发者大会演讲稿
bboss集团网站: bboss组项目博客: bboss版本重建方法 gradle安装 开发工程生成方法: dle蚀 Gradle的想法 亦可以直接通过idea或eclipse gradle插件将下载的bboss源码工程导入eclipse或者idea bboss原始码 ...