This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
There is a note in the text of jspInit method that says: invocations to the getServletConfig() method will return the desired value. So we can at least retrieve a ServletConfig object, rather than having it passed in. But why wouldn't I be able to throw an Exception and have the JSP page 'unavailable' ?
An uneducated guess. As we know JSPs are converted into Servlets by the container. So the jspInit is not directly implemented in the created Servlet. I would guess that the container takes what is in this method and put it into the Servlet's init method, which would be written for you throwing the ServletException. Plus is ServletException even available in a JSP page? The name of the Exception itself kind of answers that in that it isn't called JSPException. So that is my guess. But good question and I would be interested in finding out the real answer. Mark
It looks to me like jsp_init is some sort of dummy. Here is part of the generated code for the Tomcat example numguess.jsp. It does NOT have a custom jsp_init - instead, the service method checks to see if _jspx_init has been called, and _jspx_init does throw an exception.