Solved

Program won't compile:  Expecting ")"

Posted on 2004-08-01
3
233 Views
Last Modified: 2012-05-05
Hi guys, please take a look at my code.  I have one error left and it's driving me crazy.  On line 79 it's expecting a ")", but I don't see where or why I'd need one.  Also, now that I'm a little better with Java, does anybody use a special editor or GUI for their java development other than notepad, which is what I'm using now.

package weblocker;

import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.text.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;


public class verifycredit extends HttpServlet {
public void init() throws ServletException {
    Authenticator.setDefault(new MyAuthenticator());
      }
  public void doGet(HttpServletRequest request,
              HttpServletResponse response)
      throws ServletException, IOException {

 response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Your registration has been processed!";
    String docType =
      "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
      "Transitional//EN\">\n";
try {
      
     String MerchantID = "10011";
     String Amount = request.getParameter("Amount");
     String REFID = request.getParameter("REFID");
     String AccountNo = request.getParameter("AccountNo");
     String CCMonth = request.getParameter("CCMonth");
     String CCYear = request.getParameter("CCYear");
     String NameonAccount = request.getParameter("NameonAccount");
     String AVSADDR = request.getParameter("AVSADDR");
     String AVSZIP = request.getParameter("AVSZIP");
     String CCRURL = "";
     String myemail = ",videotwogo@yahoo.com";
     String Email = request.getParameter("Email") + myemail;
     String USER1 = request.getParameter("USER1");          //This collects the City
     String USER2 = request.getParameter("USER2");          //This collects the State
     
//Setup query string to send to backend server

  String qString= "NameonAccount="  + NameonAccount;
qString= qString + "&MerchantID="   + MerchantID;
qString= qString + "&CCRURL="       + CCRURL;
qString= qString + "&AVSADDR="           + AVSADDR;
qString= qString + "&AVSZIP="           + AVSZIP;
qString= qString + "&AccountNo="    + AccountNo;
qString= qString + "&CCMonth="           + CCMonth;
qString= qString + "&CCYear="           + CCYear;
qString= qString + "&Email="           + Email;
qString= qString + "&REFID="           + REFID;
qString= qString + "&Amount="           + Amount;
qString= qString + "&USER1="           + USER1;
qString= qString + "&USER2="           + USER2;

    HttpSession session = request.getSession();

}
 catch (Exception e)
        {
            //If any general error, notify the user.
          out.println("General exception: " + e.toString());
           // response.sendRedirect("http://www.cnn.com");
          
        }
out.println(docType +
                "<HTML>\n" +
                "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
                "<BODY BGCOLOR=\"#FDF5E6\">\n" +
                "<SCRIPT LANGUAGE=javascript>\n" +
"<!--\n" +
"window.onload=updateVariables\n" +
"function updateVariables() {\n" +
"parent.document.location = "https://webservices.primerchants.com/billing/TransactionCentral/processcreditcardonline.asp?" + "<%=qString%>";\n" +
"}\n" +
"//-->\n" +
"</SCRIPT>\n" +


"</head>\n" +
"<body>\n" +

"Dear <%=NameonAccount%>      <br><br>\n" +

"We are currently processing your order.      <br>\n" +
"Please do not use the browser back button or close this window until processing is complete.      <br>\n" +
"If there is an error in processing your order, it will be displayed here.                                    <br><br>\n" +

"Please be patient. This process can take up to 1 minute.            <br><br>\n" +

"Thank you.\n" +
                                                                                                      
"</body>\n"

out.println("</BODY></HTML>");
}
}
0
Comment
Question by:cxxxcxxx
  • 3
3 Comments
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 11688981
i think you forgot to escape a double quote:

"<%=qString%>";\n"

should be

"<%=qString%>\";\n"
0
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 500 total points
ID: 11689002
and another one here also:
"parent.document.location = "https:/..."
should be
"parent.document.location = \"https:/..."

and finally, you need to close your parenthesis and statement:
"</body>\n"
should be
"</body>\n");
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 11689085
:°)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

867 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

21 Experts available now in Live!

Get 1:1 Help Now