Time of Update: 2018-07-19
1.在程式中匯入jar:log4j-1.2.15.jar 2.建立檔案log4j.properties放置在根目錄,並增加程式碼:log4j.rootLogger=INFO,CONSOLE,DayRollingFile
Time of Update: 2018-07-19
今天把項目拷貝到另一台電腦的Eclipse時,項目出現一個紅色驚嘆號,一般這是jre環境錯誤,於是在右鍵項目->Build Path配置本機上已存在的jre1.7,然後部署項目的時候開始報錯project facet java 1.8 is not supported,意思就是之前的項目中配置的project facets模板中使用的是jdk1.8,但是現在本機上卻只有1.7,所以你要把project facets中java的版本改為1.7就可以了。參考圖如下:
Time of Update: 2018-07-19
建立圖形化介面的基本流程: 1.先建立表單 2.對表單進行基本設定 比如:大小,顯示地區,是否可見等 3.建立組件 4.對組件進行基本設定 比如:大小,初始值等 5.將組件添加到相應表單中 設定監聽的方法 1.事件來源 2.事件 3.監聽器 4.處理方式 前三個都是已經被java封裝好了的,我們只需要拿來用即可,我們要做的事情就是,寫處理方式 需求: 1.如圖,設計一個介面如上圖的程式。 2.功能:
Time of Update: 2018-07-19
//請寫出以下程式的運行結果.... public class A { public String show(D obj) { return ("A and D"); } public String show(A obj) { return ("A and A"); } public static void main(String[] args) {
Time of Update: 2018-07-19
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><html><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script
Time of Update: 2018-07-19
用tomcat6啟動時,出現下面的錯誤java.lang.NoClassDefFoundError: Lcom/opensymphony/xwork2/util/logging/Logger; Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.logging.Logger 原因是struts2的包和xwork的包的版本不同我用的是xwork-2.0.4.jar
Time of Update: 2018-07-19
習題1、 每個學生都有對應的歸屬地,學生Student,地址String類型 學生屬性:姓名和年齡 註:姓名和年齡相同的是為同一個學生,保證學生的唯一性 import java.util.*;class MapDemo {public static void main(String[] args) {HashMap<Student,String> hm=new
Time of Update: 2018-07-19
問題: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input: (2 -> 4 -> 3) + (5 -&
Time of Update: 2018-07-19
Java語言將分行符號\r\n寫進檔案時注意事項 2012-03-15 00:39:50| 分類: Java語言|舉報|字型大小 訂閱 1、將String寫入到檔案時,分行符號有一些會被過濾掉,沒有任何效果。 解決辦法:
Time of Update: 2018-07-19
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5"
Time of Update: 2018-07-19
有序否 允許元素重複否 Collection 否 是 List 是 是 Set AbstractSet 否 否 HashSet
Time of Update: 2018-07-19
package IVRInter; import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileNotFoundException;import java.io.FileWriter;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;
Time of Update: 2018-07-19
<div title="提示">移到這裡</div> <p title=""></p>等等 title屬性就是滑鼠移到相應內容上出現的提示資訊,以下有個樣式很漂亮的滑鼠提示。 ---------------------------------------------------------------------------------------
Time of Update: 2018-07-19
public class ReflectUtil {public static Class reflectClass(String className){try {return Class.forName(className);} catch (ClassNotFoundException e) {e.printStackTrace();}return null;}public static Object getClassInstance(Class clazz,
Time of Update: 2018-07-19
其實很簡單,方法如下: 每一步:進入某個https://www.xxx.com開頭的網站,把要匯入的認證下載過來, 在該網頁上右鍵 >> 屬性 >> 點擊"認證" >> 再點擊上面的"詳細資料"切換欄 >> 再點擊右下角那個"複製到檔案"的按鈕 就會彈出一個認證匯出的嚮導對話方塊,按提示一步一步完成就行了。
Time of Update: 2018-07-19
有關tomcat 6.0如何配置https服務的文章可以參考:http://blog.csdn.net/zhou_zion/article/details/6759171 以下主要講解如何使用https發起post請求: 參考文檔:梁棟前輩的《Java加密與解密的藝術》 import java.io.BufferedReader;import java.io.FileInputStream;import java.io.IOException;import
Time of Update: 2018-07-19
按照指定的列數和行數排列矩陣,代碼如下: import java.util.ArrayList; import java.util.List; /** * 排列指定大小的矩陣 * @author linyiteng1220 * */
Time of Update: 2018-07-19
接到個需求,通過log4j定時列印日誌,需求描述如下:需要能夠定時列印日誌,時間間隔可配。說到定時,首先想到了DailyRollingFileAppender類,各種定時,根據datePattern,這個可以參考類SimpleDateFormat類,常見的一些定時設定如下: [html] view plain copy print ?
Time of Update: 2018-07-19
How do I clear the Java cache? This article applies to: Platform(s):Windows 7, Vista, Windows XP, Windows 2000, Windows 2003 Java version(s):6.0, 7.0 Clearing the Java Plug-in cache forces the browser to load the latest versions
Time of Update: 2018-07-19
package com.example.test;import java.util.ArrayList;import java.util.Arrays;import java.util.HashMap;import java.util.HashSet;import java.util.List;import java.util.Map;import java.util.Set;public class ConvertorTest {/** * @param args */public