If you want to find out exactly what Java logic code the JSP translates into, you can use Jasper to generate the code. (Different JSP engines will likely generate differing output, but the scope of variables and so on should conform to the spec.) You'll need Tomcat and Ant.
This sample batch script generates the Java code for test.jsp in the output directory:
@ECHO OFF
SETLOCAL EnableDelayedExpansion
SET ANT_HOME=C:\dev\apache-ant-1.7.1
SET TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0
SET CLASSPATH="
FOR /r "%TOMCAT_HOME%\bin\" %%a IN (*.jar) DO SET CLASSPATH=!CLASSPATH!;%%a
FOR /r "%TOMCAT_HOME%\lib\" %%a IN (*.jar) DO SET CLASSPATH=!CLASSPATH!;%%a
SET CLASSPATH=!CLASSPATH!;%ANT_HOME%\lib\ant.jar"
MKDIR output
java org.apache.jasper.JspC -d .\output -webapp .\WebContent test.jsp
WebContent is the root directory of the web application. The generated code is a servlet and will follow the servlet lifecycle as defined in the spec.