Firstly, you shouldn't be putting
Java code into a JSP in the first place. That's an outdated and discredited practice that should have ended almost 10 years ago.
Time to update your JSP knowledge.
Secondly, without seeing more code, I'm not anyone can help.