码迷,mamicode.com
首页 > 其他好文 > 详细

代码杂记(四)

时间:2014-11-09 19:36:08      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:jstl   uri   

1.

Jstl用法:

所需jar包:jstl*.jar

头部引入:<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

代码:

<c:choose >

    <c:when test="${mapEl.agstatus == '布控待确认'}">  

    </c:when>

    <c:otherwise>

    </c:otherwise>

</c:choose>
2.

关闭:window.close().

3.

request.getAttribute()获取的值是由request.setAttribute()设置的,并且要类型转换;

request.getParameter()获取的是请求中?ggg&hhh中的参数,不需要类型转换。

4.

相互库之间的数据导入:

insert into mydatabase.mytable(xxx,yyyy,zzzz) select * from otherdatabase.othertable;

执行后之后再commit

5.

判断是否被选中:document.getElementById("outer").checked!=true

document.all("selAll").checked = true;等价于 document.all.selAll.checked

6.

 js设置固定格式的日期字符串:

 js获取 
 var now = new Date();
		var oneMonthAgo = new Date(now.setMonth(now.getMonth()-1));
		//year
		var datestr = oneMonthAgo.getFullYear();	
		//month
		temp = oneMonthAgo.getMonth()+1;
		if(temp<10) {
			datestr+= "-0"+temp;
		} else {
			datestr+= "-"+temp;
		}
		//day
		temp = oneMonthAgo.getDate();
		if(temp<10) {
			datestr+= "-0"+temp;
		} else {
			datestr+= "-"+temp;
		}




代码杂记(四)

标签:jstl   uri   

原文地址:http://blog.csdn.net/hzk1562110692/article/details/40950481

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!