锘??xml version="1.0" encoding="utf-8" standalone="yes"?> #涓婁紶鏂囦歡鐨勭粷瀵硅礬寰?nbsp;(涓婁紶鏃剁敤鍒扮殑鐩綍) connector.userFilesAbsolutePath = D:/temp/image #鍦╳eb涓婁嬌鐢ㄦ枃浠舵椂鐨勮櫄鎷熺洰褰? 錛堣鍙栧浘鐗囨椂鐢ㄥ埌錛?/span> connector.userFilesPath = http://localhost:8080/temp
棣栧厛鎵懼埌fckeditor.properties
鍦ㄥ叾涓姞鍏?br />
鎵懼埌浠ヤ笅浠g爜
// String typePath = UtilsFile.constructServerSidePath(request, resourceType);
// String typeDirPath = getServletContext().getRealPath(typePath);
鏇存敼浠ヤ笂涓よ浠g爜涓猴細
String typePath=D:/temp/image;
String typeDirPath =D:/temp/image;
doPost()鏂規硶鍚宒oGet鏂規硶涓鏍鋒洿鏀瑰悓鏍風殑浠g爜
涓夈佹壘鍒?font face="Verdana">fckeditor\editor\filemanager\browser\default\frmresourceslist.html鏂囦歡
鎵懼埌浠ヤ笅浠g爜:
var sCurrentFolderPath = oFolderNode.attributes.getNamedItem('path').value ;
var sCurrentFolderUrl = oFolderNode.attributes.getNamedItem('url').value ;
鍐嶅叾涓嬫柟澧炲姞
var num = sCurrentFolderUrl.indexOf('http');
sCurrentFolderUrl =sCurrentFolderUrl.substring(num,sCurrentFolderUrl.lenght);
鍥涖?nbsp; 鎵懼埌鏂囦歡fckeditor\editor\dialog\fck_image\fck_image.js
鏇存敼鏂規硶:
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ){}
鍦╯witch ( errorNumber )榪欒浠g爜涓婇潰澧炲姞浠ヤ笅浠g爜錛?br /> var num = fileUrl.indexOf('http');
fileUrl =fileUrl.substring(num,fileUrl.lenght);
===========this over .....
浠ヤ笂灝辨槸鏇存敼涓虹粷瀵硅礬寰勭殑鏁翠釜榪囩▼錛屼篃璁告湁鏇村ソ鐨勫姙娉曪紝鏈熷緟鍏跺嚭鐜?...
]]>
瀵逛簬b(甯冨皵綾誨瀷)鏉ヨ錛?/font>
濡傛灉鏄?span style="COLOR: #ff0000">瀛楃錛屽瓧絎︿覆錛屾暟瀛楋紝瀵硅薄涓簍rue錛?/font>
濡傛灉鏄?span style="COLOR: #0000ff; BACKGROUND-COLOR: #ffffff">NULL錛屽垯涓篎ALSE
聽聽System.out.format("%c\n",new Integer(50));
瀵逛簬瀛楃綾誨瀷鏉ヨ錛?/p>
鍙兘鏄細byte錛?int錛?short錛屽瓧絎?瀵瑰簲鐨勫寘瑁呯被
鍏朵粬鐨勫垯鎶ュ憡閿欒
聽
聽聽System.out.printf("%d\n",new Long("99"));
瀵逛簬鏁村瀷鏁版嵁鏉ヨ錛?/p>
濡備笅錛?span style="COLOR: #ff0000">byte short int long 鍙婂叾鍖呰綾?/span>閮藉彲浠?浣?span style="COLOR: #0000ff">float double 涓嶅彲浠?/p>
聽
聽聽System.out.printf("%f\n",123.00)錛?/p>
瀵逛簬嫻偣綾誨瀷鏉ヨ錛氬繀欏繪槸float 鎴栬呮槸 double聽聽 錛屽叾浠栭兘涓嶅彲浠?/p>
聽
聽聽System.out.format("%s",'p');
瀵逛簬瀛楃鏉ヨ錛?span style="COLOR: #ff0000">瀛楃涓詫紝鏁板瓧錛屽璞?/strong>閮藉彲浠ャ傚叾瀹炲氨鏄敤瀛楃涓叉弿榪板弬閲?/p>
聽
(2)servlet鑼冨洿鍐呯殑鍙傛暟錛屽彧鑳藉湪servlet鐨刬nit()鏂規硶涓彇寰楋紝鍦╳eb.xml涓厤緗涓嬶細
鍦╯ervlet涓彲浠ラ氳繃浠g爜鍒嗗埆鍙栫敤錛?br />
絎竴縐嶅弬鏁板湪servlet閲岄潰鍙互閫氳繃getServletContext().getInitParameter("context/param")寰楀埌
絎簩縐嶅弬鏁板彧鑳藉湪servlet鐨刬nit()鏂規硶涓氳繃this.getInitParameter("param1")鍙?/p>
Guitar guitar = new Guitar("Bourgeois", "Country Boy Deluxe",
GuitarWood.MAHOGANY, GuitarWood.ADIRONDACK,1.718);
Guitar guitar = new Guitar("Martin", "HD-28");
Guitar guitar = new Guitar("Collings", "CW-28"
GuitarWood.BRAZILIAN_ROSEWOOD, GuitarWood.ADIRONDACK,1.718,
GuitarInlay.NO_INLAY, GuitarInlay.NO_INLAY);
This code calls three versions of the constructor of a (fictional) Guitar class, meaning that information can be supplied when it鈥檚 available,rather than forcing a user to know everything about their guitar at one time (many professionals couldn鈥檛 tell you their guitar鈥檚 width at the nut).
Here are the constructors used:
public Guitar(String builder, String model) {
}
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,
float nutWidth) {
}
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,
float nutWidth,
GuitarInlay fretboardInlay, GuitarInlay topInlay) {
}
public Guitar(String builder, String model) {
}
public Guitar(String builder, String model,GuitarWood backSidesWood, GuitarWood topWood,float nutWidth) {
}
public Guitar(String builder, String model,GuitarWood backSidesWood, GuitarWood topWood,float nutWidth,
GuitarInlay fretboardInlay, GuitarInlay topInlay) {
}
Guitar guitar = new Guitar("Collings", "CW-28"
GuitarWood.BRAZILIAN_ROSEWOOD, GuitarWood.ADIRONDACK,1.718,
GuitarInlay.NO_INLAY, GuitarInlay.NO_INLAY,"Enlarged Soundhole", "No Popsicle Brace");
Guitar guitar = new Guitar("Martin", "HD-28V","Hot-rodded by Dan Lashbrook", "Fossil Ivory Nut","Fossil Ivory Saddle", "Low-profile bridge pins");
public Guitar(String builder, String model, String...features);
Guitar guitar = new Guitar("Martin", "HD-28V","Hot-rodded by Dan Lashbrook", "Fossil Ivory Nut","Fossil Ivory Saddle", "Low-profile bridge pins");
Guitar guitar = new Guitar("Bourgeois", "OMC","Incredible flamed maple bindings on this one.");
Guitar guitar = new Guitar("Collings", "OM-42","Once owned by Steve Kaufman--one of a kind");
You could add the same variable-length argument to the other constructors:
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,float nutWidth, String... features)
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,float nutWidth,
GuitarInlay fretboardInlay,GuitarInlay topInlay,String... features)
package com.oreilly.tiger.ch05;
public class Guitar {
private String builder;
private String model;
private float nutWidth;
private GuitarWood backSidesWood;
private GuitarWood topWood;
private GuitarInlay fretboardInlay;
private GuitarInlay topInlay;
private static final float DEFAULT_NUT_WIDTH = 1.6875f;
public Guitar(String builder, String model, String... features) {
this(builder, model, null, null, DEFAULT_NUT_WIDTH, null, null, features);
}
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,
float nutWidth, String... features) {
this(builder, model, backSidesWood, topWood, nutWidth, null, null, features);
}
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,float nutWidth,
GuitarInlay fretboardInlay, GuitarInlay topInlay,String... features) {
this.builder = builder;
this.model = model;
this.backSidesWood = backSidesWood;
this.topWood = topWood;
this.nutWidth = nutWidth;
this.fretboardInlay = fretboardInlay;
this.topInlay = topInlay;
}
}
public Guitar(String builder, String model, String... features)
public Guitar(String builder, String model, String[] features)
public Guitar(String builder, String model,
String... features, float... stringHeights)
Guitar guitar = new Guitar("Martin", "D-18");
public Guitar(String builder, String model)
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,float nutWidth,
GuitarInlay fretboardInlay, GuitarInlay topInlay,String... features) {
this.builder = builder;
this.model = model;
this.backSidesWood = backSidesWood;
this.topWood = topWood;
this.nutWidth = nutWidth;
this.fretboardInlay = fretboardInlay;
this.topInlay = topInlay;
for (String feature : features) {
System.out.println(feature);
}
}
public static int max(int first, int... rest) {
int max = first;
for (int i : rest) {
if (i > max)
max = i;
}
return max;
}
package com.oreilly.tiger.ch05;
public class Guitar {
private String builder;
private String model;
private float nutWidth;
private GuitarWood backSidesWood;
private GuitarWood topWood;
private GuitarInlay fretboardInlay;
private GuitarInlay topInlay;
private String[] features;
private static final float DEFAULT_NUT_WIDTH = 1.6875f;
public Guitar(String builder, String model, String... features) {
this(builder, model, null, null, DEFAULT_NUT_WIDTH, null, null, features);
}
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,
float nutWidth, String... features) {
this(builder, model, backSidesWood, topWood, nutWidth, null, null, features);
}
public Guitar(String builder, String model,
GuitarWood backSidesWood, GuitarWood topWood,
float nutWidth,
GuitarInlay fretboardInlay, GuitarInlay topInlay,
String... features) {
this.builder = builder;
this.model = model;
this.backSidesWood = backSidesWood;
this.topWood = topWood;
this.nutWidth = nutWidth;
this.fretboardInlay = fretboardInlay;
this.topInlay = topInlay;
this.features = features;
}
}
//鍙橀噺澹版槑
private List features;
//鍦ㄦ柟娉曚腑鎴栨槸鏋勯犲櫒涓殑涔﹀啓
this.features = java.util.Arrays.asList(features);
public static int max(int first, int... rest) {
int max = first;
for (int i : rest) {
if (i > max)
max = i;
}
return max;
}
int max = MathUtils.max(1, 4);
int max = MathUtils.max(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
int max = MathUtils.max(18, 8, 4, 2, 1, 0);
int[] numbers = getListOfNumbers( );
public static int max(int... values) {
int max = Integer.MIN_VALUE;
for (int i : values) {
if (i > max)
max = i;
}
return
//鐢ㄨ繖縐嶆柟娉曟潵鍙栧緱鏁板瓧
int[] numbers = getListOfNumbers( );
int max = MathUtils.max(numbers);
package com.oreilly.tiger.ch05;
public class MathUtils {
public static int max(int... values) {
if (values.length == 0) {
throw new IllegalArgumentException("No values supplied.");
}
int max = Integer.MIN_VALUE;
for (int i : values) {
if (i > max)
max = i;
}
return max;
}
}
int max = MathUtils.max(myArray);
int max = MathUtils.max(new int[] { 2, 4, 6, 8 });
int max = MathUtils.max(2, 4, 6, 8);
int max = MathUtils.max(0);
int max = MathUtils.max( );
private String print(Object... values) {
StringBuilder sb = new StringBuilder( );
for (Object o : values) {
sb.append(o)
.append(" ");
}
return sb.toString( );
}
private String print(String... values) {
StringBuilder sb = new StringBuilder( );
for (Object o : values) {
sb.append(o)
.append(" ");
}
return sb.toString( );
}
private String print(Object... values) {
StringBuilder sb = new StringBuilder( );
for (Object o : values) {
sb.append(o)
.append(" ");
}
return sb.toString( );
}
System.out.printf("The balance of %s's account is $%(,6.2f\n",account.getOwner().getFullName( ),account.getBalance( ));
PrintStream printf(String format, Object... args)
PrintStream printf(String format, Object[] args)
Object[] objectArray = getObjectArrayFromSomewhereElse( );
out.printf("Description of object array: %s\n", obj);
public Object[] getObjectArrayFromSomewhereElse( ) {
return new String[] {"Hello", "to", "all", "of", "you"};
}
out.printf("Description of object array: %s\n", obj);
run-ch05:
[echo] Running Chapter 5 examples from Java Tiger: A Developer's Notebook
[echo] Running VarargsTester...
[java] Hello
out.printf("Description of object array: %s\n", new Object[] { obj });
out.printf("Description of object array: %s\n", (Object)obj);
run-ch05:
[echo] Running Chapter 5 examples from Java Tiger: A Developer's Notebook
[echo] Running VarargsTester...
[java] [Ljava.lang.String;@c44b88