java»ñµÃÏîĿ·¾¶
/**
* »ñÈ¡·þÎñÆ÷µÄwebµØÖ·
* @return
*/
private String getWebPath(){
String _tempStr = Thread.currentThread().getContextClassLoader().getResource("").toString();
_tempStr=_tempStr.substring(6,_tempStr.length());
//½«%20»»³É¿Õ¸ñ£¨Èç¹ûÎļþ¼ÐµÄÃû³Æ´øÓпոñµÄ»°£¬»áÔÚÈ¡µÃµÄ×Ö·û´®Éϱä³É%20£©
_tempStr=_tempStr.replaceAll("%20", " ");
//²éÕÒ“WEB-INF”ÔÚ¸Ã×Ö·û´®µÄλÖÃ
int num = _tempStr.indexOf("WEB-INF");
//½ØÈ¡¼´¿É
_tempStr=_tempStr.substring(0, num);
return _tempStr;
}
Ïà¹ØÎĵµ£º
Èý²½£º
Ò»¡¢×Ô¶¨Òå±êǩʵÏÖÀࣺ myTags.java;
¶þ¡¢×Ô¶¨Òå±êÇ©¿âÎļþ£¨TLD£©: myTags.tld;
Èý¡¢Ò»¸öJSPÒ³Ã棺Ëæ±ãдÁË;
Ê×ÏÈmyTags.java
package com.tags;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
public class myTags extends ......
Ö±½Óͨ¹ýmainÈë¿Ú:
argumentsÉèÖãº-Djava.library.path=¶¯Ì¬¿âËùÔÚĿ¼
ÔÚLinuxÉϵ÷.soÎļþ£º.soÎļþ ±ØÐëÃüÃûΪ£ºlibXXX.so,È磺libJni.so
ÔÚWindowsÉϵ÷.dllÎļþ£º.dllÎļþ ÃüÃû²»Òª¼Ólib,Ö±½ÓÃüÃûΪ£ºXXX.dll È磺Jni.dll
Àý£º
¶¯Ì¬¿â£ºlibJniNassirDecrypt.so »ò JniNassirDecrypt.dll
javaµ÷Óö¯Ì¬¿â´úÂë:
Str ......
ºÜÖǻۣ¬ÆÄÓÐÊýѧÖÐÎÞÇî·ÖÎöµÄÒâζ
Õæ°®ËÀjavaÁË
public class FunnyNumbers {
public static void main(String[] args) {
double largeNum = (int)Math.exp(4000.0);
//int ²»Äܳý0
//Exception in thread "main" java.lang.ArithmeticException: / by zer oat FunnyNumbers.main(FunnyNumbers.j ......
Java´úÂë
import java.util.Timer;
import java.util.TimerTask;
import java.util.Timer;
import java.util.TimerTask;
Java´úÂë
public class Test {
public static void main(String[] args) { ......
1 ËùÓÐµÄ .java|.jsp|.html|.xml Ô´Îļþ¾ùʹÓÃutf-8±àÂë¸ñʽ±£´æµ½ÏµÍ³´ÅÅÌ¡£
È磺ÔÚEclipseÖбà¼Îļþ£¬Ñ¡ÖÐÎļþ´ò¿ªÓÒ¼ü²Ëµ¥Ñ¡ÔñÊôÐÔ£¬½«Îı¾Îļþ±àÂëÉèÖÃΪÆäËû²¢Ñ¡ÔñUTF-8£»Ò²¿ÉÒÔÔÚ
Eclipse——Ê×Ñ¡Ïî——³£¹æ——ÄÚÈÝÀàÐÍÖÐÉèÖø÷ÖÖÎļþµÄȱʡ±àÂ룬ÕâÑùÒÔºóËùÓеÄÎı¾Îļþ¶¼Ê¹ÓÃÍ³Ò ......