[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Error compiling JSP file

Posted on 2004-03-20
1
Medium Priority
?
217 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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

873 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