java²Ù×÷Excel
// ´´½¨Excel
String destFileName = tableName + ".xls";//ÎļþÃû
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=".concat(String .valueOf(destFileName)));
WorkbookSettings wbs = new WorkbookSettings();
WritableWorkbook w = Workbook.createWorkbook(response .getOutputStream(), wbs);//´ò¿ªÎļþ
jxl.write.WritableSheet ws = w.createSheet("sheet0", 0);// // Éú³ÉÃûΪ“sheet0”µÄ¹¤×÷±í£¬²ÎÊý0±íʾÕâÊǵÚÒ»Ò³
// ÔÚLabel¶ÔÏóµÄ¹¹Ôì×ÓÖÐÖ¸Ãûµ¥Ôª¸ñλÖÃÊǵÚÒ»ÁеÚÒ»ÐÐ(0,0)
// ÒÔ¼°µ¥Ôª¸ñÄÚÈÝΪtest
Label label = new Label(0, 0, "test123");
// ½«¶¨ÒåºÃµÄµ¥Ôª¸ñÌí¼Óµ½¹¤×÷±íÖÐ
sheet.addCell(label);
// ×ÖÌåÉèÖÃ
WritableFont font = new WritableFont(WritableFont.createFont("¿¬Ìå_GB2312"), 12, WritableFont.BOLD);
WritableCellFormat format = new WritableCellFormat(font);
format.setBackground(jxl.format.Colour.GRAY_25);
format.setLocked(false);//µ¥Ôª¸ñËø¶¨
format.setBorder(jxl.format.Border.ALL,
jxl.format.BorderLineStyle.getStyle(1));
format.setWrap(true);//ÉèÖÃ×Ô¶¯»»ÐÐ
// ×ÖÌåÉèÖýáÊø
// µ¥Ôª¸ñÉèÖÃÄÚÈÝ£¨ÒÔϱíʾ£¬µÚiÁУ¬µÚ1ÐУ©
·½Ê½1£º
ExcelUtil.makeCellData(ws, i, 0, (String) map.get("BTF_TITLE"), ExcelUtil.LABEL_ALIGN_LEFT,ExcelUtil.BORDER_LINE_ALL, null, ExcelUtil.CELL_TYPE_LABEL,jxl.format.Colour.GRAY_25);
·½Ê½2£º
ws.addCell(new Label(i, 0, (String) map.get("BTF_TITLE"), format));
//×îºóдÎļþ£¬¹Ø±Õ
w.write();
w.close();
//º
Ïà¹ØÎĵµ£º
±¾ÆªÖ¼ÔÚ°ïÖú×¼±¸Ñ§Ï°JavaÒÔ¼°¸Õ½Ó´¥JavaµÄÅóÓÑÈÏʶ¡¢ÕÆÎÕºÍʹÓÃstatic¡¢this¡¢super¡¢finalÕ⼸¸ö¹Ø¼ü×ÖµÄʹÓá£Java²©´ó¾«ÉÎÒÒ²ÊÇһλÕýÔÚѧϰºÍʹÓÃJavaµÄ°®ºÃÕߣ¬ÎÄÖÐÄÑÃâÓв»Í×Ö®´¦£¬»¶ÓÖ¸Õý¡£
Ò»¡¢static
¡¡ÇëÏÈ¿´ÏÂÃæÕâ¶Î³ÌÐò£º
public class Hello{
public static void main(String[] args){ ......
ʼþÔ´¸ºÔð²úÉúʼþ
ʼþÀࣺ¶¨ÒåʼþµÄÌØÕ÷£»
¼àÌýÆ÷½Ó¿Ú£º¶¨Òå¼àÌýÆ÷Ó¦¸ÃʵÏֵŦÄÜ£»
¼àÌýÆ÷£ºÊµÏÖ¼àÌýÆ÷½Ó¿Ú£¬¼àÌýʼþµÄ·¢Éú²¢×÷³öÏìÓ¦£»
ËùÓеÄʼþÀà±ØÐë¼Ì³ÐJavaʼþ»ùÀ࣬¼´java.util.EventObject£»EventObject(Object source)ÊÇEventObjectΨһµÄ¹¹Ôì·½·¨£¬ÕâÒâζ×ÅËùÓÐʼþ±ØÐëÔÚʵÀý»¯Ê±¾ÍÖ¸¶¨Ê¼þÔ´ ......
Java ¶àÏ̱߳à³ÌÖ®Èý£ºsynchronized ¹Ø¼ü×ÖµÄʹÓÃ
´øÓÐ synchronized ¹Ø¼ü×ֵķ½·¨´ú±íÕâ¸ö·½·¨¼ÓËø¡£Ç¡µ±¶øÓÖÁé»îµØÔËÓà synchronized ¹Ø¼ü×Ö£¬ÊǶàÏ̱߳à³ÌµÄ±ØÐ޿Ρ£
¡¡¡¡1¡¢synchronized¹Ø¼ü×ÖµÄ×÷ÓÃÓòÓжþÖÖ£º
¡¡¡¡1£©ÊÇij¸ö¶ÔÏóʵÀýÄÚ£¬synchronized aMethod(){}¿ÉÒÔ·ÀÖ¹¶à ......
Ò».µã»÷ͼÊ飬չʾ¸ÃÊéµÄÏêϸÐÅÏ¢
µã»÷ͼÊé→booksÒ³Ãæ→ͨ¹ýurlÖØдdisplayBook.jsp?isbn=¸ÃÊé±àºÅ →´«ÈëdisplayBooksÒ³Ãæ→
<c:set var="isbn" value="${param.isbn}"></c:set>
<c:forEach var="currentBook" items="${sessionScope.bookTitles}">
<c:if test="${ ......
JavaÊÂÎñAPI£¨JTA£»Java Transaction API£©ºÍËüµÄͬ°ûJavaÊÂÎñ·þÎñ(JTS£»Java TransactionService)£¬ÎªJ2EEƽ̨ÌṩÁË·Ö²¼Ê½ÊÂÎñ·þÎñ¡£Ò»¸ö·Ö²¼Ê½ÊÂÎñ£¨distributedtransaction£©°üÀ¨Ò»¸öÊÂÎñ¹ÜÀíÆ÷£¨transaction manager£©ºÍÒ»¸ö»ò¶à¸ö×ÊÔ´¹ÜÀíÆ÷(resource manager)¡£Ò»¸ö×ÊÔ´¹ÜÀíÆ÷£¨resource manager£©ÊÇÈÎÒâÀàÐ͵ ......