代碼雜記(四)

1.

Jstl用法:

所需jar包:jstl*.jar

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

代碼:

<c:choose >

    <c:when test="${mapEl.agstatus == 'xxxx'}">  

    </c:when>

    <c:otherwise>

    </c:otherwise>

</c:choose>

eqequal

ne:not equal

2.

關閉:window.close().

3.

request.getAttribute()獲取的值是由request.setAttribute()設置的,並且要類型轉換;

request.getParameter()獲取的是請求中?ggg&hhh中的參數,不需要類型轉換。

4.

相互庫之間的數據導入:

insert intomydatabase.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;
		}




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章