Solved

Program won't compile:  Expecting ")"

Posted on 2004-08-01
3
239 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
[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
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

617 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