EL表达式fn:endsWith函数的bug

jstl-1.2.jar

1
2
3
4
5
6
7
8
9
10
11
12
public static boolean endsWith(String input, String substring) {
if (input == null)
input = "";
if (substring == null)
substring = "";
int index = input.indexOf(substring); // should be indexOf应该是lastIndexOf 才对
if (index == -1)
return false;
if ((index == 0) && (substring.length() == 0))
return true;
return index == input.length() - substring.length();
}

欢迎关注我的其它发布渠道