File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes need help urgentl  like yesterdayy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "need help urgentl  like yesterdayy" Watch "need help urgentl  like yesterdayy" New topic
Author

need help urgentl like yesterdayy

Erwin Bredford
Ranch Hand

Joined: Feb 11, 2003
Posts: 167
i am passing some form parameters to the database but the Tomcat keep give me this error
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\Program Files\...\subscriptions_action_jsp.java:247: ';' expected
[javac] int intNumberOfSaleSwapOfDuplicateItems= Integer.parseInt(strNumberOfSaleSwapOfDuplicateItems);
[javac] ^
[javac] 1 error
now the varaiable its complainiong about is ok nothing i have been stuck for close to 6 hrs trying to figures it out here is the jsp file
IT STARTS HERE
:BE CAREFUL IT REFERENCES OTHER CLASSES
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="XFoundation.*" %>
<%@ page import="Sonic.*" %>
<%@include file="/includes/global.jsp" %>



<%
//==============================================================
//FileName: Subscription_action.jsp
//Purpose: Perform necceaary action based on the function the user want to perform
//Parameters:
//Description
//Pass Type : All parameters are passed via Request.form() method
//Behaviours
//Objects
//Anticipated Changes
//==========================================================================
//==========================================================================
//Main Function - Code Entry Point
//==========================================================================
//********BEGIN MAIN SCRIPT AREA
//Get the form values
long longSubscriptionID=Long.valueOf("0").longValue();
int intActionID=0;
String strTitle="";
String strShortDescription="";
String strLongDescription="";
String strActive="";
String strViewMediaContent="";

String strViewPublicLibrariesAndCollection="";
String strViewPublicDiscussionBoards="";
String strEditPublicDiscussionBoards="";
String strViewPrivateDiscussionBoards="";
String strEditPrivateDiscussionBoards="";
String strViewPublicBlogs="";
String strEditPublicBlogs="";
String strViewPrivateBlogs="";

String strEditPrivateBlogs="";
String strIncludePhotosInBlogs="";
String strWishWatchList="";
String strSkinAndCustomizeMySite="";
String strNumberOfItemsInMyCollection="";
String strNumberOfSwapsPerMonth="";
String strNumberOfPurchasesPerMonth="";
String strStatusMuliplierTradingListPosition="";
String strNumberOfMailers="";
String strNumberOfSalesPerMonth="";
String strNumberOfSaleSwapOfDuplicateItems="";

String strAdvertisingAsAnExtraPaidOption="";
String strAnnualSubscriptionFee="";
String strDepositedOnSonicswapAccount="";
String strAdditionalFeeForSalesOver20="";

String strAdditionalFeeForSalesOver="";
String strAdditionalTransactionFee="";
String strAdditionalTransactionFee2="";
String strSonicswapPerReferral="";


String c_CodeFileName = "subscriptions_action.jsp";
String c_MethodName = "DoMain()";
booleanbContinue = false;
String strContinueURL = "";
String strMsg = "";
String strURL = "";

clsSubscription objSubscription=new clsSubscription();
clsXDataObject objXDataObject = new clsXDataObject();
clsXDebug objXDebug = new clsXDebug(GLOBAL_DEBUG_FILENAME, GLOBAL_DEBUG_LEVEL);

objXDataObject.m_objXDebug = objXDebug;
objSubscription.m_objXDebug = objXDebug;
objSubscription.m_objXDataObject = objXDataObject;

objXDebug.Msg(c_CodeFileName,c_MethodName,"intActionID" );


strTitle = request.getParameter("Title");
strShortDescription = request.getParameter("ShortDescription");
strLongDescription = request.getParameter("LongDescription");
strActive = request.getParameter("Active");

strViewMediaContent = request.getParameter("AccessViewMedia");
strViewPublicLibrariesAndCollection = request.getParameter("AccessViewPublicCollection");
strViewPublicDiscussionBoards = request.getParameter("AccessViewPublicBoard");
strEditPublicDiscussionBoards = request.getParameter("AccessEditPublicBoard");
strViewPrivateDiscussionBoards = request.getParameter("AccessViewPrivateBoard");

strEditPrivateDiscussionBoards = request.getParameter("AAccessEditPrivateBoard");

strViewPublicBlogs = request.getParameter("AccessViewPublicBlog");
strEditPublicBlogs = request.getParameter("AccessEditPublicBlog");
strViewPrivateBlogs = request.getParameter("AccessViewPrivateBlog");

strEditPrivateBlogs = request.getParameter("AccessEditPrivateBlog");
strIncludePhotosInBlogs = request.getParameter("AccessEditPhotoBlog");
strWishWatchList = request.getParameter("AccessWishList");
strSkinAndCustomizeMySite = request.getParameter("AccessSkinSite");

strNumberOfItemsInMyCollection = request.getParameter("NumberOfItemsInCollection");
strNumberOfSwapsPerMonth = request.getParameter("NumberOfSwap");
strNumberOfPurchasesPerMonth = request.getParameter("NumberOfPurchase");
strNumberOfSalesPerMonth = request.getParameter("NumberOfSale");
strStatusMuliplierTradingListPosition = request.getParameter("StatusMultiplier");
strNumberOfMailers = request.getParameter("NumberOfMailer");
strNumberOfSaleSwapOfDuplicateItems = request.getParameter("LimitSaleSwapDuplicateItem");

strAdvertisingAsAnExtraPaidOption = request.getParameter("AdvertisingPaidOption");
strAnnualSubscriptionFee = request.getParameter("SubscriptionFee");
strDepositedOnSonicswapAccount = request.getParameter("Deposit");
strAdditionalFeeForSalesOver20 = request.getParameter("AddlFeeAmtForSaleOver20");
strAdditionalFeeForSalesOver = request.getParameter("AddlFeePctForSaleOver20");
strAdditionalTransactionFee = request.getParameter("AddlSaleTransactionFee");
strAdditionalTransactionFee2 = request.getParameter("AddlSaleTransactionPct");
strSonicswapPerReferral = request.getParameter("SonicSwapDollarsPerReferral");


//change the datatype of the radiobutton values 1/0 to int

try{

int intActive=Integer.valueOf("0").intValue();

}
catch(Exception e){}
try{
intActive=Integer.valueOf(strActive).intValue();
}
catch(Exception e){}

int intViewMediaContent=Integer.parseInt("0").intValue();


intViewMediaContent=Integer.parseInt(strViewMediaContent).intValue();




int intViewPublicLibrariesAndCollection=Integer.parseInt(strViewPublicLibrariesAndCollection);
int intViewPublicDiscussionBoards=Integer.valueOf(strViewPublicDiscussionBoards);
int intEditPublicDiscussionBoards=Integer.valueOf(strEditPublicDiscussionBoards);

int intNumberOfItemsInMyCollection=Integer.parseInt(strNumberOfItemsInMyCollection);
int intViewPrivateDiscussionBoards=Integer.parseInt(strViewPrivateDiscussionBoards);
int intEditPrivateDiscussionBoards=Integer.parseInt(strEditPrivateDiscussionBoards);
int intViewPublicBlogs=Integer.parseInt(strViewPublicBlogs);
int intEditPublicBlogs=Integer.parseInt(strEditPublicBlogs);
int intViewPrivateBlogs=Integer.parseInt(strViewPrivateBlogs);
int intEditPrivateBlogs=Integer.parseInt(strEditPrivateBlogs);
int intIncludePhotosInBlogs=Integer.parseInt(strIncludePhotosInBlogs);
int intWishWatchList=Integer.parseInt(strWishWatchList);
int intSkinAndCustomizeMySite=Integer.parseInt(strSkinAndCustomizeMySite);
int intNumberOfSwapsPerMonth=Integer.parseInt(strNumberOfSwapsPerMonth);
int intNumberOfPurchasesPerMonth=Integer.parseInt(strNumberOfPurchasesPerMonth);

int intAdvertisingAsAnExtraPaidOption=Integer.parseInt(strAdvertisingAsAnExtraPaidOption);
int intNumOfSales=Integer.parseInt(strNumberOfSalesPerMonth);
int intNumOfMailer=Integer.parseInt(strNumberOfMailers)
int intNumberOfSaleSwapOfDuplicateItems=Integer.parseInt(strNumberOfSaleSwapOfDuplicateItems);
try {intActionID = Integer.parseInt(request.getParameter("ActionID"));}
catch (Exception e) {intActionID=Integer.parseInt("0");}
try {longSubscriptionID = Long.valueOf(request.getParameter("SubscriptionID")).longValue();}
catch (Exception e) {longSubscriptionID=Long.valueOf("0").longValue();}



objXDebug.Msg(c_CodeFileName,c_MethodName,"intActionID=" + String.valueOf("intActionID"));
objXDebug.Msg(c_CodeFileName,c_MethodName,"longSubscription=" + String.valueOf("longSubscritptionID"));

objXDebug.Msg(c_CodeFileName,c_MethodName,"strTitle=" + strTitle);


objXDataObject.Connect (GLOBAL_DB_CONN_STRING,GLOBAL_DB_USERNAME,GLOBAL_DB_PASSWORD,GLOBAL_DATABASE_CLASSNAME);

//This will add values into the subscription atble
if (intActionID == ACTION_ADD)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"THIS AN ADD");
if (objSubscription.CreateObjectRecord(intViewMediaContent, intViewPublicLibrariesAndCollection, intViewPublicDiscussionBoards, intEditPublicDiscussionBoards, intViewPrivateDiscussionBoards, intEditPrivateDiscussionBoards, intViewPublicBlogs, intEditPublicBlogs, intViewPrivateBlogs, intEditPrivateBlogs, intIncludePhotosInBlogs, intWishWatchList, intSkinAndCustomizeMySite) == true)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"Contact object was successfully created");
objSubscription.bitActive(intActive);
objSubscription.strTitle(strTitle);
objSubscription.strShortDescription(strShortDescription);
objSubscription.strLongDescription(strLongDescription);
objSubscription.bitAccessViewMedia(intViewMediaContent);
objSubscription.bitAccessViewPublicCollection(intViewPublicLibrariesAndCollection);
objSubscription.bitAccessViewPublicBoard(intViewPublicDiscussionBoards);
objSubscription.bitAccessEditPublicBoard(intEditPublicDiscussionBoards);
objSubscription.bitAccessViewPrivateBoard(intViewPrivateDiscussionBoards);
objSubscription.bitAccessEditPrivateBoard(intEditPrivateDiscussionBoards);
objSubscription.bitAccessViewPublicBlog(intViewPublicBlogs);
objSubscription.bitAccessEditPrivateBlog(intEditPublicBlogs);
objSubscription.bitAccessEditBlogPhoto(intIncludePhotosInBlogs);
objSubscription.bitAccessWishList(intWishWatchList);

objSubscription.bitAccessSkinSite(intSkinAndCustomizeMySite);

objSubscription.intNumberOfItemsInCollections(intNumberOfItemsInMyCollection);

objSubscription.intNumOfSwaps(intNumberOfSwapsPerMonth);
objSubscription.intNumOfPurchases(intNumberOfPurchasesPerMonth);
objSubscription.intNumOfSales(intNumOfSales);
objSubscription.intNumOfMailer(intNumOfMailer);
objSubscription.strStatusMultiplier(strStatusMuliplierTradingListPosition);

objSubscription.intLimitSaleSwapDuplicateItem(intNumberOfSaleSwapOfDuplicateItems);
objSubscription.intAdvertisingPaidOption(intAdvertisingAsAnExtraPaidOption);
objSubscription.strSubscriptionFee(strAnnualSubscriptionFee );
objSubscription.strDeposit(strDepositedOnSonicswapAccount);
objSubscription.strAddlFeeAmtForSalesOver20(strAdditionalFeeForSalesOver20);
objSubscription.strAddlFeePctForSalesOver20(strAdditionalFeeForSalesOver);

objSubscription.strAddlSaleTransactionFee(strAdditionalTransactionFee);
objSubscription.strAddlSaleTransactionPct(strAdditionalTransactionFee2);
objSubscription.strSonicswapDollarsPerReferral(strSonicswapPerReferral);

if (objSubscription.UpdateObjectRecord() == true)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"Thank you for your submission. We will contact you shortly.");
bContinue = true;
strMsg = "Thank you for your submission. We will contact you shortly.";
strContinueURL = "subscription_view.jsp";
}
else
{
strMsg = "An error occurred while trying to save your contact information";
objXDebug.Msg(c_CodeFileName,c_MethodName,"Contact object was not successfully updated");
bContinue = false;
objXDebug.Msg(c_CodeFileName,c_MethodName,strMsg);
strContinueURL = "back";
}
}
else
{
strMsg = "An error occurred while trying to save your Subscription";
objXDebug.Msg(c_CodeFileName,c_MethodName,"Contact object was not successfully created");
bContinue = false;
objXDebug.Msg(c_CodeFileName,c_MethodName,strMsg);
strContinueURL = "back";
}
}
//IS THIS AN UPDATE
else if (intActionID == 2)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"THIS AN UPDATE");
if (objSubscription.LoadObjectRecord(longSubscriptionID) == true)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"Subscription object was successfully loaded");
objSubscription.bitActive(intActive);
objSubscription.strTitle(strTitle);
objSubscription.strShortDescription(strShortDescription);
objSubscription.strLongDescription(strLongDescription);
objSubscription.bitAccessViewMedia(intViewMediaContent);
objSubscription.bitAccessViewPublicCollection(intViewPublicLibrariesAndCollection);
objSubscription.bitAccessViewPublicBoard(intViewPublicDiscussionBoards);
objSubscription.bitAccessEditPublicBoard(intEditPublicDiscussionBoards);
objSubscription.bitAccessViewPrivateBoard(intViewPrivateDiscussionBoards);
objSubscription.bitAccessEditPrivateBoard(intEditPrivateDiscussionBoards);
objSubscription.bitAccessViewPublicBlog(intViewPublicBlogs);
objSubscription.bitAccessEditPrivateBlog(intEditPublicBlogs);
objSubscription.bitAccessEditBlogPhoto(intIncludePhotosInBlogs);
objSubscription.bitAccessWishList(intWishWatchList);
objSubscription.bitAccessSkinSite(intSkinAndCustomizeMySite);
objSubscription.intNumberOfItemsInCollections(intNumberOfItemsInMyCollection);
objSubscription.intNumOfSwaps(intNumberOfSwapsPerMonth);
objSubscription.intNumOfPurchases(intNumberOfPurchasesPerMonth);
objSubscription.intNumOfSales(intNumOfSales);
objSubscription.intNumOfMailer(intNumOfMailer);
objSubscription.strStatusMultiplier(strStatusMuliplierTradingListPosition);
objSubscription.intLimitSaleSwapDuplicateItem(intNumberOfSaleSwapOfDuplicateItems);
objSubscription.intAdvertisingPaidOption(intAdvertisingAsAnExtraPaidOption);
objSubscription.strSubscriptionFee(strAnnualSubscriptionFee );
objSubscription.strDeposit(strDepositedOnSonicswapAccount);
objSubscription.strAddlFeeAmtForSalesOver20(strAdditionalFeeForSalesOver20);
objSubscription.strAddlFeePctForSalesOver20(strAdditionalFeeForSalesOver);

objSubscription.strAddlSaleTransactionFee(strAdditionalTransactionFee);
objSubscription.strAddlSaleTransactionPct(strAdditionalTransactionFee2);
objSubscription.strSonicswapDollarsPerReferral(strSonicswapPerReferral);




if (objSubscription.UpdateObjectRecord() == true)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"Contact object was successfully updated with description");
bContinue = true;
strMsg = "The subscription <b>" + strTitle + " </b>has been updated.";
strContinueURL = "subscriptions_view.jsp?longSubscriptionID=" + String.valueOf(objSubscription.lngSubscriptionID());
}
else
{
strMsg = "ERROR - Subscription object was not successfully updated with description";
bContinue = false;
objXDebug.Msg(c_CodeFileName,c_MethodName,strMsg);
strContinueURL = "back";
}
}
else
{
strMsg = "ERROR - Subscription object was NOT successfully loaded";
bContinue = false;
objXDebug.Msg(c_CodeFileName,c_MethodName,strMsg);
strContinueURL = "back";
}
}
//this is a delete operation
else if (intActionID == 3)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"THIS A DELETE");
if (objSubscription.LoadObjectRecord(longSubscriptionID) == true)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"Contact object was successfully loaded");
strTitle = objSubscription.strTitle();
if (objSubscription.DeleteObjectRecord() == true)
{
objXDebug.Msg(c_CodeFileName,c_MethodName,"Contact object was successfully deleted");
bContinue = true;
strMsg = "The contact <b>" + strTitle + " </b>has been deleted.";
strContinueURL = "adminpanel_contact_list.jsp";
}
else
{
strMsg = "ERROR - Contact object was not successfully deleted";
bContinue = false;
objXDebug.Msg(c_CodeFileName,c_MethodName,strMsg);
strContinueURL = "back";
}
}
else
{
bContinue = false;
strMsg = "ERROR - Contact object was NOT successfully loaded";
objXDebug.Msg(c_CodeFileName,c_MethodName,strMsg);
strContinueURL = "back";
}
}
else
{
bContinue = false;
strMsg = "An unknown error has occurred.";
objXDebug.Msg(c_CodeFileName,c_MethodName,strMsg);
strContinueURL = "back";
}
if (bContinue == true) {strURL="subscriptions_view.jsp";}
else {strURL="contact_error.jsp";}
strURL = strURL + "?strmsg=" + response.encodeRedirectURL(strMsg) + "&strcontinueurl=" + response.encodeRedirectURL(strContinueURL);
objXDebug.Msg(c_CodeFileName,c_MethodName,"strContinueURL=" + strContinueURL);
objXDebug.Msg(c_CodeFileName,c_MethodName,"strMsg=" + strMsg);

objXDataObject.DisposeRecordset();
objXDataObject.Disconnect();
objXDebug.CloseLogFile();

response.sendRedirect(strURL);
%>
[ November 17, 2003: Message edited by: Marilyn de Queiroz ]

--One learns a lot during a lesson but seeing is not enough,you must do;knowing is not enough ,you must apply--<br />SCJP 1.4,SCBCD,SCEA part 1,OCM JEE Enterprise Architect.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34


The error message says that a ';' was expected, and points right to the word "int" on the second line above. In those six hours, didn't you ever look at this location in the source, to check the character before the word "int" to see if there was a missing ';'? There is, indeed, a missing ';'. Add one.


[Jess in Action][AskingGoodQuestions]
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
A "I think I'll go home and get some rest now" moment!


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Error's around line 247. Please type in the line numbers next time, makes it easier for the rest of us.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Erwin Bredford
Ranch Hand

Joined: Feb 11, 2003
Posts: 167
thanks for your i have it fixed
the problem is not with the that jsp
but the a java class it references .thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help urgentl like yesterdayy