![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java基础
beautycloud
这个作者很懒,什么都没留下…
展开
-
Struts2 拦截器学习笔记
使用Struts拦截器需要注意的地方: Struts2拦截器类必须从com.opensymphony.xwork2.interceptor.Interceptor接口继承,在Intercepter接口中有如下三个方法需要实现: [code="java"] void destroy(); void init(); String intercept(ActionInvocation invo...原创 2011-12-27 12:33:49 · 101 阅读 · 0 评论 -
Struts 中获取session、request及response对象的方法
我们平常所说的session一般是HttpSession,但在struts2中被封装成了Map类型。 这个map对象里面可以存放键值对,而且我们可以在前台页面中通过相应的表达式将值取出来,如何在Action中获取session呢?下面是一些常用的方法: 1、获取session [code="java"] Map session = ActionContext.getContext().g...原创 2011-12-28 13:31:55 · 299 阅读 · 0 评论 -
JSTL标签之c标签
JSTL中的fn方法在页面中进行字符串的截取时,是非常有用的,在现在的产品开发中用到了该方法,因此在这里记录一下: [code="java"] ${fn:substring(name,0,6)}... ${name} [/code] 下面对fn:substring(str,beginIndex,endIndex)进行简单的说明: 这个方法应该不难理解,使用的...原创 2011-12-29 11:04:04 · 94 阅读 · 0 评论 -
Java去除两个日期之间的周末,只算工作日(传递Date对象)
/** * 获取两个日期之间的工作日天数 * @param startDate * @param endDate * @return 间隔的天数 */ @SuppressWarnings("deprecation") public static int getDutyDays(java.util.Date startDate,java.util.Date en...2011-11-16 17:42:43 · 539 阅读 · 0 评论 -
Java去除两个日期之间的周末,只算工作日(传递String对象)
@SuppressWarnings("deprecation") public int getDutyDays(String strStartDate,String strEndDate) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date startDate=null; Date endDate ...2011-11-17 10:16:15 · 228 阅读 · 0 评论