give me java.lang.NullPointerException what went wrong??? this is in a servlet. Thanks
w*r
2 楼
debug it , your value turned out to be null somewhere before this line...
【在 l*****k 的大作中提到】 : give me java.lang.NullPointerException : what went wrong??? this is in a servlet. : Thanks
v*e
3 楼
secondly, you can check to see if it's regular expression error. pretty sure % is a special char in regular expressions. If it is, you need to escape it. For example, in order to replace / with \, you need to do value.replaceAll("/","\\\\");
【在 w*r 的大作中提到】 : debug it , your value turned out to be null somewhere before this line...
c*z
4 楼
% is not a special char in regular expression. Even if it was, it throws illegal expression expression instead of null pointer ones.
【在 v********e 的大作中提到】 : : secondly, you can check to see if it's regular expression error. pretty sure : % is a special char in regular expressions. If it is, you need to escape it. : For example, in order to replace / with \, you need to do : value.replaceAll("/","\\\\");