Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Program won't compile:  Expecting ")"

Posted on 2004-08-01
3
Medium Priority
?
241 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

721 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