This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I tried to throw a simple exception and got the error: Unable to compile class for JSPC:\jakarta-tomcat-3.2.1\work\localhost_8080%2Fjspadmin\_0002fcsr_0002fAccountBillto_0002ejspAccountBillto_jsp_0.java:229: Statement not reached. out.write("\r\n"); ^ 1 error Note that I am doing this inside an include file. And the including file is specifying the errorPage. e.g.
Thanks Pho [This message has been edited by Pho Tek (edited May 16, 2001).]
maha anna
Ranch Hand
Joined: Jan 31, 2000
Posts: 1467
posted
0
I suspect the error is more related to your coding logic than throwing exceptions. Somewhere in your code a "return" or "throw someException" is there which is in "definite execute" path. There are some code under those return/throw kind of statement which can not be reached. So the compiler throws this error. Please post your code. regds maha anna [This message has been edited by maha anna (edited May 16, 2001).]
saravanakumar sundaram
Greenhorn
Joined: May 16, 2001
Posts: 5
posted
0
Please find below some code on exception errorpage JSP. Errorpage.jsp -------------- <%@ page isErrorPage="true" %> <html> <body> <h1> Error Page </h1> <hr> <h2> Received the exception:<br> <font color=red> <%= exception.toString() %> </font> </h2> </body> </html> Errorhandler.jsp ---------------- <%@ page errorPage="errorpage.jsp" %> <html> <body> <form method=post action="errhandler.jsp"> What's the coolest programming language in the known universe?<p> Java<input type=radio name=language value="JAVA" checked> C++<input type=radio name=language value="CPP"> Visual Basic<input type=radio name=language value="VB"> <p> <input type=submit> </form> <% if (request.getMethod().equals("POST")) { if (request.getParameter("language").equals("JAVA")) { out.println("<hr><font color=red>You got that right!</font>"); } else { throw new Exception("You chose the wrong language!"); } } %> </body> </html> May be this could help you.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Want my exceptions to be caught by errorPage JSP ?