This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See you shouldnot be putting Java code in your JSP! Please read this JspFaq entry. Java scriptlets have been discredited since 2002. That's 10 years ago!
You should be employing the JSTL and EL in your pages, which by the way, makes it impossible for you to be getting the kinds of errors that you are currently experiencing.