Recently, I was trying to split a string into two separate array values in a JSP, for displaying them separately through JSTL. I commented out
and Eclipse seemed to be fine with it. So, I went on to write more code utilizing my new array, and refreshed the page…everything worked fine. But, the page markup was not changing to reflect the JSP changes. It was heavily cached for some reason. So, I restarted the server, and reloaded the page, and got the following error:
This is difficult to track down because my IDE effectively told me there was a ClassNotFoundException, which every StackOverflow post points to being an issue with class paths or output folders for a project; none of them point to actual code problems. Also, the compiler did not catch this as a problem, either. Where is your strong type handling now, Java?
After spending so much time tracking down this problem, I’m starting to understand the allure of using a single language on the client as on the server (e.g. NodeJS). Not having to switch contexts would have prevented this problem in the first place. Or maybe one day I’ll be a better Java developer that won’t make these kinds of mistakes (ha!).