The best way to find out the answer to this question is to write JSP with a method, run it, and then view the generated servlet code. Different containers will store this code in different places so you'll need to check the documentation for the one you're using.