Should I add try/catch around when casting on an attribute of JSP implicit object?
- by Michael Mao
Hi all:
Basically what I mean is like this:
List<String[]> routes = (List<String[]>)application.getAttribute("routes");
For the above code, it tries to get an attribute named "routes" from the JSP implicit object - application. But as everyone knows, after this line of code, routes may very well contains a null - which means this…