code: public static boolean isJsp21(ServletContext context)
      {
          //if running on GAE, treat like it is JSP 2.0
          if(isRunningOnGoogleAppEngine(context))
          {
              return false;
          }
          
          try 
          {
              // simply check if the class JspApplicationContext is available
              Class.forName("javax.servlet.jsp.JspApplicationContext");
              return true;
          } 
          catch (ClassNotFoundException ex) 
          {
              // expected exception in a JSP 2.0 (or less) environment
          }
          
          return false;
      }
docs: Determines whether we're running in a Servlet 2.5/JSP 2.1 environment.
  
  @return <code>true</code> if we're running in a JSP 2.1 environment,
  <code>false</code> otherwise