Time of Update: 2018-07-26
(1)、request.getRealPath("/");//不推薦使用擷取工程的根路徑 (2)、request.getRealPath(request.getRequestURI());//擷取jsp的路徑,這個方法比較好用,可以直接在servlet和jsp中使用
Time of Update: 2018-07-26
package com.JUnit; /** * java線程測試 * @author RSun * @Date 2012-10-26下午02:12:56 * @Email */ public class Test { public static void main(String[] args) { new TestThread().start();
Time of Update: 2018-07-26
對於Set 要實現排序功能,一般有兩種途徑,這裡對基本類型不適用,基本類型一般有Arrays中的靜態方法. 1.對象本身實現Comparable介面,那麼該類的執行個體就是可以排序的.有關Comparable: http://blog.csdn.net/treeroot/archive/2004/09/09/99613.aspx只要實現了Comparable介面,就可以調用Collections的sort方法對集合中的元素排序.
Time of Update: 2018-07-26
setScale對BigDecimal類型的數值進行精度的處理。 public BigDecimal setScale(int newScale, int roundingMode) { ...} newScale 保留BigDecimal的位元。 roundingMode 有以下幾種處理模式: public final static int ROUND_UP = 0; public final static int
Time of Update: 2018-07-26
最終目標:在Linux下提供一個穩定可靠的Java簡訊發送伺服器。 第一階段:在Win32平台下編碼並測試; 第二階段:在Linux平台下部署並測試; 目錄: 相關資源:(Java Communication包) Win32串口編程前期準備 Win32簡訊Modem的測試步驟和AT指令: Linux串口編程前期準備 列出系統所有串口、並口,來找到簡訊Modem所使用的串口名字 測試串口速率 Win32/Linux下串口編程的差異
Time of Update: 2018-07-26
import java.io.ByteArrayInputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.InputStream;/** * 將二進位流轉換成圖片檔案 * @author 晚風工作室 www.soservers.com * */public class ImgErToFileUtil {/** *
Time of Update: 2018-07-26
目錄 1. 簡介 2. 安裝 3. log4j基本概念 3.1. Logger 3.2. Appender 3.2.1. 使用ConsoleAppender 3.2.2. 使用FileAppender 3.2.3. 使用WriterAppender 3.3. Layout 3.4. 基本樣本 3.4.1.
Time of Update: 2018-07-26
關於string記憶體配置不錯的部落格:http://blog.csdn.net/rj042/article/details/6871030 String常量池問題的幾個例子 樣本1: Java代碼 String s0="kvill"; String s1="kvill"; String s2="kv" + "ill"; System.out.println( s0=
Time of Update: 2018-07-26
將正在正常啟動並執行tomcat打包(使用tar -zcvf命令打的包),然後放到其他伺服器上使用非root使用者解壓(使用tar -zxvf命令)配置好之後,啟動tomcat後報錯如下 HTTP Status 500 - java.lang.IllegalStateException: No output folder typeException report messagejava.lang.IllegalStateException: No output
Time of Update: 2018-07-26
已經讀到博士了,可是感覺還是一無是處,想給自己充充電,怎奈學一個東西卻是這樣的困難。 想學JAVA的念頭由來很久,算起來大概有半年多了,但是真正開始向這個目標發起進攻卻是一個月以前的事情,下載了所有的工具,還有一大堆書籍,我不怕英文,畢竟已經博士了,讀這點洋文不在話下,然而我沒有志同道合者共同學習,只有自己一個人孤軍奮戰,遇到問題只有求助於網路,有的時候能得到滿意的答案,但更多的時候則是更加失望。
Time of Update: 2018-07-26
註:轉載請註明出處。/** ------------------------public method -------------------------*//*** 為array添加remove方法* * @param s* 移除的數組中的值* @return*/Array.prototype.remove = function(s) {for ( var i =
Time of Update: 2018-07-26
http://a52071453.iteye.com/blog/1706949 <span style=""> </span><span style="">今天在給平台使用者提供http簡單介面的時候,順便寫了個調用的Java類供他參考。</span><br style=""><span style=""> &
Time of Update: 2018-07-26
如果你只是建一個java工程,又不想將其放在src目錄下,可以使用如下方法進行指定log4j.properties所在的位置。 private void InitLog4jConfig() {Properties props = null;FileInputStream fis = null;try {// 從設定檔dbinfo.properties中讀取配置資訊props = new Properties();fis = new
Time of Update: 2018-07-26
package com.segsec.gisap.webservice;import java.util.Vector;import javax.xml.namespace.QName;import org.apache.axis.client.Call;import org.apache.axis.client.Service;import org.apache.axis.encoding.XMLType;public class LbsRescue {private String url =
Time of Update: 2018-07-26
寫了幾個調用例子: 1、 import org.apache.axis.client.*; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; import javax.xml.rpc.JAXRPCException; import javax.xml.
Time of Update: 2018-07-26
/* * 1.擷取當前運行代碼的類名,方法名,行號,主要是通過java.lang.StackTraceElement類 * * 2. * [1]獲得調用者的方法名, 同new Throwable * String _methodName = new Exception().getStackTrace()[1].getMethodName(); * [0]獲得當前的方法名, 同new Throwable * String
Time of Update: 2018-07-26
post傳參和擷取參數: /** * 擷取post參數 * @param is * @param charset * @return */public static String getContent(InputStream is, String charset) {String pageString = null;InputStreamReader isr = null;BufferedReader br = null;StringBuffer sb = null;try {isr
Time of Update: 2018-07-26
查看CentOS內建JDK是否已安裝。 ◆輸入:yum list installed |grep java。 若有內建安裝的JDK,如何卸載CentOS系統內建Java環境。 ◆卸載JDK相關檔案輸入:yum -y remove java-1.7.0-openjdk*。 ◆卸載tzdata-java輸入:yum -y remove tzdata-java.noarch。 當結果顯示為Complete。即卸載完畢。 註:“*”表示卸載掉java 1.
Time of Update: 2018-07-26
這兩天在做http服務端請求操作,用戶端post資料到服務端後,服務端通過request.getParameter()進行請求,無法讀取到資料,搜尋了一下發現是因為設定為text/plain模式才導致讀取不到資料 urlConn.setRequestProperty("Content-Type","text/plain;
Time of Update: 2018-07-26
官方網站:http://jawinproject.sourceforge.net 把lib檔案夾下的jawin.jar和jawin-stubs.jar放到%JAVA_HOME%/jre/lib/ext 目錄下 把bin檔案夾下的jawin.dll放到%SystemRoot%/System32 目錄下 然後就可以運行demo下的Hellodll.java了: /* * HelloDll.java - * * This file is part of the Jawin Project: