`
jd406
  • 浏览: 47863 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
文章列表
这里只列出一个在工作中遇到的问题。 简单列的说明: 1、work_date: Date 类型 2、time_signin: timestamp 类型 现在要按年或者按月统计信息,所以需要用到模糊查询。 测试发现,模糊查询针对的是字符串,不能对Date或者timestamp使用,怎么解决这个问题呢? 肯定是要把work_date或者time_signin转换成字符串! 之前对Oracle比较熟,自然想到用to_char,但是发现下面这种用法也不对: to_char(work_date,"yyyy-MM") 查了下资料,发现在DB2中,to_char对timestamp类 ...
首先定义一个可以进行全选和反选的checkbox: <input type="checkbox" name="all" id="all" onclick="checkAll(this)" /> 当然,下面会有很多的checkbox需要进行操作,采用下面的方式: <input type="checkbox" name="indexed" id="indexed${taskId}" value="${taskId}&qu ...
1、Spinner 老规矩,先设置布局文件: <Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/planet_prompt" /> 在res/values/下面创建一个文件string.xml文件,文件内容如下: <?xml vers ...
1、CheckBox的使用: 先肯定是在布局文件中加入相关设置,这里加两个checkBox <CheckBox android:id="@+id/checkbox1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/basketball" /> <CheckBox android:id="@+ ...
1、设置TextView的显示值: 方法一: <!--在res->values->string.xml中加入如下值--> <string name="textView_text">TextView中的显示文字</string> 然后在对应布局文件(如main.xml)的对应TextView控件中加入如下代码: <!--最重要的是设置text的那行代码--> <TextView android:layout_width="fill_parent" an ...
如果在页面中不涉及到第三方的插件(比如:artDialog),可以用如下的方式打开子页面 window.open(...) 子页面中获取父页面对象:window.opener window.showModalDialog(..) 子页面中获取父页面对象:window.dialogargument 这里可以给大家看一个帖子,我觉的还不错,比较详细的介绍了获取值和设置值的方法,以及刷新页面和关闭页面的方法。帖子的地址是: http://topic.csdn.net/u/20091112/09/342769c1-0abf-4f92-8699-7ac7d462e0cf.html 如果 ...
JSTL中的fn方法在页面中进行字符串的截取时,是非常有用的,在现在的产品开发中用到了该方法,因此在这里记录一下: <!--这里进行一个判断,如果name的长度大于7,显示名字...; 否则显示全名--> <c:if test="${fn:len ...

OGNL学习笔记

一直不知道OGNL是个什么东西,只知道在网页中可以采用下面两种常用的方式进行输入控制: ${userName} <s:property value="userName" /> 这两种有什么区别呢?今天对照着官方文档(http://struts.apache.org/2.2.1/docs/ognl.html)做了一个小测试: 官方文档的原文是: The Action instance is always pushed onto the value stack. Because the Action is on the stack, and the stac ...
我们平常所说的session一般是HttpSession,但在struts2中被封装成了Map类型。 这个map对象里面可以存放键值对,而且我们可以在前台页面中通过相应的表达式将值取出来,如何在Action中获取session呢?下面是一些常用的方法: 1、获取session Map session = ActionContext.getContext().getSession(); session.put("userName",userName); ActionContext.getContext().getSession().remove(key); 2、获 ...
使用Struts拦截器需要注意的地方: Struts2拦截器类必须从com.opensymphony.xwork2.interceptor.Interceptor接口继承,在Intercepter接口中有如下三个方法需要实现: void destroy(); void init(); String intercept(ActionInvocation invocation) throws Exception; 在Struts2中已经在struts-default.xml中预定义了一些自带的拦截器,如timer、params等。如果在<package>标签中继承struts ...
@SuppressWarnings("deprecation") public int getDutyDays(String strStartDate,String strEndDate) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date startDate=null; Date endDate = null; try { startDate=df.parse(strStartDate); endDate = df.parse(strEndD ...
/** * 获取两个日期之间的工作日天数 * @param startDate * @param endDate * @return 间隔的天数 */ @SuppressWarnings("deprecation") public static int getDutyDays(java.util.Date startDate,java.util.Date endDate) { int result = 0; java.text.SimpleDateFormat df = new java.text.SimpleDateFormat(" ...
Global site tag (gtag.js) - Google Analytics