I have below code in a
JSP as a method. When the date is null, the method throws StringIndexOutOfBoundsException and stops executing. Isn't this the whole point of putting the try/catch block in this code? Why does the code stop executing (stop loading the page)?
-------------------------------------------------
private
String parseDate(String date) {
String tmp = "";
try {
tmp = date.substring(4,6) + "/" + date.substring(6,8) + "/" + date.substring(0,4);
} catch (Exception x) {
tmp = "";
}
return tmp;
}