??xml version="1.0" encoding="utf-8" standalone="yes"?> #上传文g的绝对\?nbsp;(上传时用到的目录) connector.userFilesAbsolutePath = D:/temp/image #在web上用文件时的虚拟目? Q读取图片时用到Q?/span> connector.userFilesPath = http://localhost:8080/temp
首先扑ֈfckeditor.properties
在其中加?br />
扑ֈ以下代码
// String typePath = UtilsFile.constructServerSidePath(request, resourceType);
// String typeDirPath = getServletContext().getRealPath(typePath);
更改以上两行代码为:(x)
String typePath=D:/temp/image;
String typeDirPath =D:/temp/image;
doPost()Ҏ(gu)同doGetҎ(gu)一h改同L(fng)代码
三、找?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; 扑ֈ文gfckeditor\editor\dialog\fck_image\fck_image.js
更改Ҏ(gu):
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg ){}
在switch ( errorNumber )q行代码上面增加以下代码Q?br /> var num = fileUrl.indexOf('http');
fileUrl =fileUrl.substring(num,fileUrl.lenght);
===========this over .....
以上是更改为绝对\径的整个q程Q也许有更好的办法,期待其出?...
]]>
对于b(布尔cd)来说Q?/font>
如果?span style="COLOR: #ff0000">字符Q字W串Q数字,对象为trueQ?/font>
如果?span style="COLOR: #0000ff; BACKGROUND-COLOR: #ffffff">NULLQ则为FALSE
(tng) (tng)System.out.format("%c\n",new Integer(50));
对于字符cd来说Q?/p>
只能是:(x)byteQ?intQ?shortQ字W?对应的包装类
其他的则报告错误
(tng)
(tng) (tng)System.out.printf("%d\n",new Long("99"));
对于整型数据来说Q?/p>
如下Q?span style="COLOR: #ff0000">byte short int long ?qing)?strong>包装c?/span>都可??span style="COLOR: #0000ff">float double 不可?/p>
(tng)
(tng) (tng)System.out.printf("%f\n",123.00)Q?/p>
对于点cd来说Q必Lfloat 或者是 double (tng) (tng) Q其他都不可?/p>
(tng)
(tng) (tng)System.out.format("%s",'p');
对于字符来说Q?span style="COLOR: #ff0000">字符Ԍ数字Q对?/strong>都可以。其实就是用字符串描q参?/p>
(tng)
(2)servlet范围内的参数Q只能在servlet的init()Ҏ(gu)中取得,在web.xml中配|如下:(x)
在servlet中可以通过代码分别取用Q?br />
W一U参数在servlet里面可以通过getServletContext().getInitParameter("context/param")得到
W二U参数只能在servlet的init()Ҏ(gu)中通过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’s available,rather than forcing a user to know everything about their guitar at one time (many professionals couldn’t tell you their guitar’s 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
//用这U方法来取得数字
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