Why not find bean replaceAll this function

Category: Web Develop
 
wingtmp04
2008-12-25 11:05:47

Sponsored Links
Jsp pages in the surface but can be used
and pour in the bean has a java.lang. *
Code line str = str.replaceAll (temp, "");
error
ExpArrange.java: 81: Can't find method `replaceAll (Ljava / lang / String; Ljava / lang /
S
tring ;) 'in ; type `java.lang.String '.
; str = str.replaceAll (temp, "");
; ^
1 error
Environment is rh9 the j2sdk-1.4.1-fcs

Sponsored Links

wu171404263myxkd
2008-12-25 11:19:32
write a
public String replaceAll (String regex, String replacement) {
int begin = str.indexOf (regex);
int end = begin + regex.length ();
int j = str.indexOf (str.substring (begin, end));
str = str.substring (0, j) + replacement + str.substring (j + str.substring (begin, end)
. length (), str.length ());
return str;
}
AB931271301C
2008-12-25 11:36:41
version is not it.
I use 1.4.2 no problem.
yangyi2083334
2008-12-25 11:51:14
JDK1.4 began to have replaceAll of
q263544252
2008-12-25 12:11:05
Why it can be used in jsp page replaceAll () This function does
boss888666
2008-12-25 12:13:31
is definitely wrong somewhere the
zhutaocool
2008-12-25 12:26:27
use replace () it, the effect is the same
zxc4982183
2008-12-25 12:32:54
java.lang. * is not referenced.

str = str.replaceAll (temp, ""); str somewhere you this assignment? Is it empty? Paste the code a little more, so easy to find fault.
cxl039
2008-12-25 12:37:39
public void checkExpArrange () {
String str = getOldExpArrange ();
; String includeStr = "#";
String subStr = "" ;;
String firstStr = getFirstArrange ();
str = str + includeStr;
int begin = 0, end = 0, size = 0;
for (int i = 0; i <str.length (); i + +) {
; end = str.indexOf (includeStr, begin);
if (end> begin) {
subStr = str.substring (begin, end);
if (subStr.startsWith (firstStr) && subStr. length ()-firstStr.length () == 2) {
String temp = includeStr + subStr;
/ / str = str.replaceAll (temp, "");
int j = str.indexOf (temp);
; str = str.substring (0, j) + str.substring (j + temp.length () +1, str.length () -2);
}
begin = end;
}
begin + +;
; if (begin> = str.length ())
break;
size + +;
}
str = str.substring (0, str.length () -1 );
setOldExpArrange (str);
}
jackyluolai
2008-12-25 12:50:25
str = str . replaceAll (temp, "");
parameter is definitely a problem here, and he tells you that, you can not override this method,
other words, temp problems, output ; what its value look
zw917629
2008-12-25 12:56:06
str = str + includeStr;
you print out the sentence below the str look to see what the content inside.

String temp = includeStr + subStr;
this is also printed out
cellphonetxj111
2008-12-25 12:58:23
temp and subStr printed in jsp is correct
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.