any suggestions?

<%@ page language="java" %>

<%@ page import="trader.webservices.data.LeadDAO" %>
<%@ page import="trader.aabacrm.LeadsList" %>
<%@ page import="trader.webservices.data.*" %>
<%@ page import="trader.webservices.presentation.Lead" %>
<%@ page import="trader.webservices.data.UserInfoDAO" %>
<%@ page import="trader.webservices.data.UserDataVO" %>
<%@ page import="trader.webservices.data.ButtonDAO" %>
<%@ page import="trader.webservices.constants.UserConstants" %>
<%@ page import="trader.webservices.util.Utils" %>
<%@ page import="java.math.*" %>


<%
    RequestDispatcher dispatcher = request.getRequestDispatcher("/jsp/ErrorPage.jsp");

    UserDataVO userData = null;

    String username = request.getParameter("username");
    String password = request.getParameter("password");

    boolean loginOkay = false;
    boolean trialOkay = true;
    boolean pageError = false;

    if ((username != null) && (password != null)) {
        loginOkay = UserInfoDAO.verifyLogin(username,password);
        if (loginOkay) trialOkay = UserInfoDAO.checkTrialOkay(username);
    }

    if (loginOkay && trialOkay) {
        try{
            /**
            * Get accountInfo based on accountName
            */
            if (username != null) {
                userData = UserInfoDAO.getUserInfo(username);
            }
            if (userData != null) {
                userData.setHeaderLogo(UserInfoDAO.getHeaderLogo(userData));
                userData.setMaxMB(UserInfoDAO.getMaxMB(userData.getAccountID()));
                UserInfoDAO.getCriticalPathData(userData); 

            } else {
                pageError = true;
            }
        }catch(Exception e){
            request.setAttribute("pageError","An error occured trying to log into control panel.");
            dispatcher.forward(request, response);
        }
    }
    String mainpageText = UserInfoDAO.getMainpageText(userData);
%>

<%
// preparse results of the transfer to emc and other specific pages that send back to here, if applicable
String otherResults = "";

try {
  if (request.getParameter("lastAction").equals("emcTransfer")) {
    int leadsUpdated = Integer.parseInt(request.getParameter("lead_upd"));
    int leadsCreated = Integer.parseInt(request.getParameter("lead_new"));
    int leadsErrored = Integer.parseInt(request.getParameter("lead_err"));
    otherResults = "You transferred " + (leadsUpdated+leadsCreated) + " leads. " + leadsUpdated + " updated, " + leadsCreated + " new.";
    if (leadsErrored > 0) {
        otherResults = otherResults + " " + leadsErrored + " leads were duplicates or could not be transferred to the Email Marketing Center.";
    }
  }
} catch (Exception e) {
  otherResults = "";
}
%>





    <%

        try
        {
            System.out.println("The domainName string is: " + domainName);
             //Get accountInfo based on domainName
            domainName = UserInfoDAO.removeHostRedirection(domainName);
            userData = UserInfoDAO.getUserInfo(domainName);
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
            response.sendRedirect("../ErrorPageCPanel.jsp");
        }

        //for beta controlpanel, get the domain name from the form post (this is how it always works in old cp)
        if (userData == null) {
            userData = UserInfoDAO.getUserInfo(request.getParameter("username"));
        }

        if (userData!=null) {               
            //get HashMap from biz layer of leads/contacts
            int agentId = userData.getAgentID();
            int adverId = userData.getAdverID();
            //System.out.println("agentId:" + agentId);
            //System.out.println("adverId:" + adverId);
            LeadsList leads = null;
            HashMap currLead = null;

            String agentOrBroker = null;
            int agentOrAdverId = 0;
            if (adverId == 0) { //agent site
                agentOrBroker = "agent";
                agentOrAdverId = agentId;
            } 
            else {
                agentOrBroker = "broker";
                agentOrAdverId = adverId;
            }


            if (sOrderBy.equals("")) {
                leads = new LeadsList(agentOrBroker,agentOrAdverId);
            } 
            else {
                if (bOrderDesc) 
                {
                    String orderBy[] = sOrderBy.split(",");
                    String expandedOrderBy = orderBy[0] + " DESC";
                    for (int i = 1; i < orderBy.length; i++) 
                    {
                        expandedOrderBy += "," + orderBy[i] + "DESC";
                    }
                    leads = new LeadsList(agentOrBroker,agentOrAdverId,expandedOrderBy);
                } 
                else {
                    leads = new LeadsList(agentOrBroker,agentOrAdverId,sOrderBy);
                }
            }

            %>







<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Control Panel - Website &amp; Content</title>
<link rel="stylesheet" type="text/css" media="screen" href="/JAABA/skins/aaDefault/styles/cp-contentwell.css" />
</head>


<body>

        <jsp:include page="../Includes/controlPanel/sessionInfo.jsp" >
            <jsp:param name="username" value="<%=userData.getAcctName()%>" />
        </jsp:include>

        <!--This sets up the javascript array that holds the leads. -->
        <script language="JavaScript">

                int unViewedCt = 0;
                  out.write("var jsLeads = new Array();\n");
                    for (int i=0; i< leads.size(); i++) {
                      currLead = (HashMap)leads.get(i);

                        out.write("jsLeads["+ i +"] = new Array();\n");
                        out.write("jsLeads[" + i + "][0] = '" + currLead.get("PK_LEADID") + "';\n");
                        out.write("jsLeads[" + i + "][1] = '" + currLead.get("CON_ID") + "';\n");
                        out.write("jsLeads[" + i + "][2] = " + currLead.get("BO_VISIBLE") + ";\n"); 
                        //could be null in the table but is NVL'd in the view
        //              Integer currVis =(Integer) currLead.get("BO_VISIBLE");
        //              System.out.println("currVis:" + currVis);
        //              out.write("jsLeads[" + i + "][2] = " + Utils.getStringNull((((Integer)currLead.get("BO_VISIBLE")).toString()),"0") + ";\n");

                        if (new Integer(currLead.get("BO_VIEWED").toString()).intValue() == 0 ) {

                            unViewedCt++;
                        }
                    }
        </script>            




<div id="cWell" class="clearfix">

<h1>Welcome to your New Control Panel</h1>

<div id="cWellMain">

<%=mainpageText%>

<!-- START OLD SCHOOL NEWS BOX -->
<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td colspan="2" align="CENTER" bgcolor="#FFCF63"><font face="Arial,Helvetica,Sans-Serif" size="4"><b>Real Estate News</b></td></tr><tr><td><font face="Arial,Helvetica,Sans-Serif" size="3"><b>Consumer News</b></font><br>

<br><a href="news-sample.html" title="Consumers aren't being cocky when they expect to reap profits from the sale of their home, even in a down market. "><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><b>Consumers: "What Housing Bust?"</b></font><br>
<font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><i>JUN 25, 2007</i></font></a><br>
<br><a href="javascript:submit_form_with_qs('newsstory=222917');" title="How do you really measure square footage in a condominium unit? "><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><b>Housing Counsel: The Quagmire Called Square Footage</b></font><br><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><i>JUN 25, 2007</i></font></a><br>
<br><a href="javascript:submit_form_with_qs('newsstory=222919');" title="A study prepared for the Mortgage Bankers Association of America estimates that incidence of home loan fraud jumped by 30"><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><b>Mortgage Fraud Rising Fast; Florida and California Now the Hot Spots</b></font><br><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><i>JUN 25, 2007</i></font></a><br>
<br><a href="javascript:submit_form_with_qs('newspage=Consumer');"><font face="Arial,Helvetica,Sans-Serif" size="2" color="#993333"><b><i>More Consumer News</i></b></font></a><br>
</td><td><font face="Arial,Helvetica,Sans-Serif" size="3"><b>Commercial News</b></font><br>
<br><a href="javascript:submit_form_with_qs('newsstory=222920');" title="An entire team working for you -- even when you sleep? "><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><b>A Day In The Life Of A Virtually Supported Agent</b></font><br><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><i>JUN 25, 2007</i></font></a><br>
<br><a href="javascript:submit_form_with_qs('newsstory=222921');" title="Working from home can help real estate agents be more productive if they know how to make their surroundings function well"><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><b>Ten Ways To Work Real Estate More Effectively From Home</b></font><br><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><i>JUN 25, 2007</i></font></a><br>

<br><a href="javascript:submit_form_with_qs('newsstory=222822');" title="The California Association of Realtors (CAR) opposes private transfer taxes and has sought legislation that would prohibit them. "><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><b>Legislative Support for Private Transfer Taxes</b></font><br><font face="Arial,Helvetica,Sans-Serif" size="1" color="#993333"><i>JUN 22, 2007</i></font></a><br>
<br><a href="javascript:submit_form_with_qs('newspage=Commercial');"><font face="Arial,Helvetica,Sans-Serif" size="2" color="#993333"><b><i>More Commercial News</i></b></font></a><br>
  </td></tr></table>
<!-- END OLD SCHOOL NEWS BOX -->

</div><!-- end cWellMain -->


<div id="cWellSide">


<div id="stats">
    <h3><%= unViewedCt++ %></h3>
    <p>stats go here</p>
</div>

<div class="ad">
<div id="ad1"><p>To view product &amp; service opportunities from <strong>Agent Advantage</strong>, please install the <a href="http://www.adobe.com/go/gntray_dl_getflashplayer" target="_blank">Flash Plug-in</a>.</p></div>
</div><!-- end ad -->

<div class="ad">
<div id="ad2"><p>To view product &amp; service opportunities from <strong>Agent Advantage</strong>, please install the <a href="http://www.adobe.com/go/gntray_dl_getflashplayer" target="_blank">Flash Plug-in</a>.</p></div>
</div><!-- end ad -->

</div><!-- end cWellSide -->

</div><!-- END cWell -->
</body>
</html>

thanx....

Recommended Answers

All 9 Replies

I don't think you're in the right forum. It looks like you want this one. And when you need help it's best to be specific about what problem you're having. Just asking for suggestions and pasting reams of code won't get you much. I'd probably be able to help you, but I have no idea what you want... :(

my bad...Im getting a "catch without try"..and all my brackets seem to be lined up...im thinking its somewhere between lines 163-185..not sure whats wrong though...I'll try posting in the other spot...sorry bout that

It's no biggie. But I'm sure that there are a few arrogant people around here that love to flame anyone who makes an innocent mistake. Better me helping you out than them driving you away, right? :)

im thinking its somewhere between lines 163-185..

Don't you get a line number with the error? Can you point it out? Lines 163-185 don't contain a catch at all. This is a syntax error so it should be pretty easy to locate with help from the compiler.

unfortunately this is what I get:

org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

PWC6199: Generated servlet error:
string:///cp_002dfrontpage_jsp.java:300: 'catch' without 'try'

It says line 300. That's probably right where the offending catch is and you can look back up to find the matching try. I'd help, but I don't have a way of matching the error's line 300 to the line numbers in the code you posted.

The same response I gave in the JSP forum for this question. Move all of this scriptlet stuff out of the JSP into one, or more, beans.

commented: You can tell em but they don't listen. +9

appreciate it fellas.....

your problem is the catch (Exception e) statement that catches your 1st try..
it is called as the Unreachable code problem.

catch (Exception e) is a method of the exception class which is the supreclass to all exceptions and handles all exceptions. so this method shold come as last catch....
if it comes b4 other catches other catches will be ignored as catch (Exception e) statement handles all exceptions... so you get that error

it is called as the Unreachable code problem.


for more details on what i mean check this link

http://www.tutorialhero.com/tutorial-73-catch_multiple_exceptions_in_java.php

And if those tutorials advocate widespread use of scriptlets they are absolutely worthless. Advocating practices that lead to unscaleable and nearly unmaintainable code is not acceptable.

Edit: Not to mention that this thread is two years dead. Killing this zombie now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.