You should be doing this in the controller now as you don't need to have this scriptlet in the JSP.