If your JSP code is almost 2/3rd pure Java code, then you’re doing something wrong. One easy way of knowing Java code from HTML/Snippets is to look at the PALE GREEN (see image for color tone). If the pale green is more than the white – then you must be joking.
If you move the green parts to become white on their own java files; Your future self will thank you for it.
Or at least you won’t get cursed.