Do not use
JSP for this. Writing raw
Java code in a JSP is a very bad practice. Raw Java code belongs in Java classes. Use a
Servlet class for this and your problem will automagically disappear. Use JSP for presentation only, with taglibs and EL only, no scriptlets.