Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Error compiling JSP file

Posted on 2004-03-20
1
Medium Priority
?
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Sometimes Administrators rights are not enough. These cases call for the SYSTEM account. The process in this article outlines the steps required to execute commands using the SYSTEM account.
Let's take a look into the basics of ransomware—how it spreads, how it can hurt us, and why a disaster recovery plan is important.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

609 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