We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Error compiling JSP file

timjg asked
Medium Priority
Last Modified: 2010-04-01
I'm getting the following errors when I try to compile the JSP file that follow.  Any help with this greatly appreciated.

trackingErrorPage$jsp.java [118:1] 'else' without 'if'
                        else if (exception instanceof Class NotFoundException )
trackingErrorPage$jsp.java [130:1] 'else' without 'if'

JSP file follows below:

?xml version = "1.0"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!-- trackingErrorPage.jsp -->

<%-- page settings --%>
<%@ page isErrorPage = "true" %>
<%@ page import = "java.util.*" %>
<%@ page import = "java.sql.*" %>

<html xmlns = "http://www.w3.org/1999/xhtml">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 12px;
      color: #660033;


    <p class = "error">

    <% // scriptlet to determine exception type
       // and output beginning of error message
       if ( exception instanceof SQLException )

        An SQLException

        else if (exception instanceof Class NotFoundException )
        A ClassNotFoundException


        An exception

    <%-- end scriptlet to insert fixed template data --%>

        <%-- continue error message output --%>
        occurred while entering data in the tracking database.


    <p class = "error">
        The error meassage was:<br />
        <%= exception.getMessage() %>

    <p class = "error">Please try again later.</p>

Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.