Solved

Error compiling JSP file

Posted on 2004-03-20
1
198 Views
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">

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

<style type="text/css">
    .error


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

</style>
</head>

<body>
    <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

    <%
        else
    %>

        An exception

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

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

    </p>

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

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

</html>
   
0
Comment
Question by:timjg
1 Comment
 
LVL 14

Accepted Solution

by:
kennethxu earned 125 total points
ID: 10641121
try this:

    <% // 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

    <%
        } else {
    %>

        An exception

     <%
        }
     %>

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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
loop through list of objects 14 186
jersey maven project error 7 134
rebasing and merging used in SCM 1 63
struts hibernate integration example 28 113
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now