Time of Update: 2018-07-26
SpringMVC自訂轉換器 1.建立自訂轉換器類並實現Converter介面 // 該類用來自訂 String 到 Integer的轉換過程public class MyIntConverter implements Converter<String, Integer>{ @Override public Integer convert(String param) { System.out.println(param); //
Time of Update: 2018-07-26
Spring與MyBatis整合 1.Spring與MyBatis的整合主要就是設定檔的整合(applicationContext.xml)<context:property-placeholder location="classpath:db.properties"/> <!-- 串連池 --> <bean name="dataSource"
Time of Update: 2018-07-26
Struts2與Spring的整合 1.Struts2與Spring的整合主要就是把Struts中的Action交給Spring來管理 第一步:在Spring的設定檔中添加一個Action類的bean(以UserAction為例) 也可以不在設定檔中寫 直接在Action類中使用註解也可以 <bean name="userAction" class="com.xxx.action.UserAction" scope="
Time of Update: 2018-07-26
MyBatis環境搭建 1.首先下載MyBatis所需要的jar包 並匯入工程中2.編寫核心設定檔 <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"><configuration> <!-- 載入設定檔 必須放到Src下
Time of Update: 2018-07-26
1. 單元測試的目的 一個單元測試從整個系統中單獨檢驗產品程式碼的『一個單元』並檢查其得到的結果是否是預期的。要測試的『一個單元』其大小是依據一組連貫的功能的大小及介於一個類別及一個包 (package) 之間實際上的變化 (varies) 。其目的是在整合程式碼到系統的其餘部分之前先測試以便找出程式碼中的臭蟲( bugs )。 Junit 等支援在
Time of Update: 2018-07-26
前一篇介紹了線上應用程式中斷排查之一:高CPU佔用,這篇主要分析高記憶體佔用故障的排查。 搞Java開發的,經常會碰到下面兩種異常: 1、java.lang.OutOfMemoryError: PermGen space 2、java.lang.OutOfMemoryError: Java heap space 要詳細解釋這兩種異常,需要簡單重提下Java記憶體模型。
Time of Update: 2018-07-26
import com.mysql.jdbc.Buffer;import org.apache.commons.fileupload.FileItem;import org.apache.commons.fileupload.ProgressListener;import org.apache.commons.fileupload.disk.DiskFileItemFactory;import
Time of Update: 2018-07-26
把二個時間的的年月日分別對比,完全相等就是同一天,代碼下: private static boolean isSameDate(Date date1, Date date2) { Calendar cal1 = Calendar.getInstance(); cal1.setTime(date1); Calendar cal2 = Calendar.getInstance(); cal2.setTime(date2);
Time of Update: 2018-07-26
架構springboot 這裡使用web3j當前eth官方推薦的整合jdk來做說明。當然你也可以使用它最底層的rpc方案來編寫(官網也有說明)。 這裡做個總結 第一步:先引入jdk [maven]
Time of Update: 2018-07-26
Java面試題-web篇十五 148,AJAX有哪些有點和缺點。 優點:
Time of Update: 2018-07-26
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException:
Time of Update: 2018-07-26
package com.mybatisLearn.jdbcDao;import java.sql.*;class BaseDao { //URL private static String url = "jdbc:mysql://127.0.0.1:3306/test_data"; //username private static String userName = "root"; //password
Time of Update: 2018-07-26
/* *通過Udp將文字發送出去 * 提供資料,封裝資料包 * socket發送 * 關閉資源 */class UdpSendDemo { public static void main(String[] args) throws IOException { //建立udp服務 DatagramSocket ds = new DatagramSocket(); //確定資料 封裝為資料包 byte[] data =
Time of Update: 2018-07-26
Java面試題-javaweb篇七 61,JDBC訪問資料庫的基本步驟是什麼。 1,載入驅動 2,通過DriverManager對象擷取連線物件Connection 3,通過連線物件擷取會話 4,通過會話進行資料的增刪改查,封裝對象 5
Time of Update: 2018-07-26
java集合(下)——集合架構與演算法詳解
Time of Update: 2018-07-26
//// Source code recreated from a .class file by IntelliJ IDEA// (powered by Fernflower decompiler)//package com.xping.sdk.config;public class XpingConfiguration { private String baseAddress; private String addDevAddress; private String
Time of Update: 2018-07-26
5個強大的Java分布式緩衝架構
Time of Update: 2018-07-26
充分利用 Java 的中繼資料,第 3 部分:進階處理作者:Jason Hunter 瞭解一些用於在運行時(甚至是編譯時間)處理批註以及更改程式行為的技術和機制。 在本系列文章(共四篇)的第一篇文章中,我介紹了 Java 的新中繼資料工具以及內建的批註類型 @Override、@Deprecated 和 @SuppressWarning。在第二篇文章中,我介紹了如何編寫自訂批註類型並使用 java.lang.annotation
Time of Update: 2018-07-26
Java並發:線程間通訊與協作 摘要:
Time of Update: 2018-07-26
在JAVA中線程到底起到什麼作用! 這是javaeye上非常經典的關於線程的文章,寫的非常通俗易懂的,適合任何讀電腦的同學.。