| Here's the complete class: Basically, it initiates a JNI method that could take awhile and waits for a user to enter in some Cash, once the cash has met the expected value (all handled in the C class) then it returns and I'd like to return the results to the current browser. I'm initiating this in a Thread to avoid using a WOMetaRefresh page, I just don't like using MetaRefresh... And so the user sees a repeating flash animation until all Cash is inserted and then a response is generated and they are redirected to a ReviewDetails page. public class PayReader { public int expectedValue = 1; public int cashInserted = 0; public native int matrixCashRead(int expectedValue); static { System.loadLibrary("MatrixCash"); } public WOResponse CashRead(PayReader pr,Application myApp,Session mySess){ pr.cashInserted = pr.matrixCashRead(pr.expectedValue); System.out.println("Total Cash Inserted: $" + pr.cashInserted); System.out.println("----"); String buildURL = "http://" + myApp.host() + ":" + myApp.port() + "/cgi-bin/WebObjects/BSSKIOSK.woa/wa/CashRead?wosid=" + mySess.sessionID() + "&completed=1&totalcash=" + pr.cashInserted; WORequest requestFinish = new WORequest("GET",buildURL,"HTTP/1.1",null,null,null); WOHTTPConnection connectTo = new WOHTTPConnection(myApp.host(),myApp.port().intValue()); connectTo.sendRequest(requestFinish); WOResponse response = connectTo.readResponse(); return response;
} public Number addCash(String value, Number currentValue){ return new Integer(Integer.parseInt(value) + currentValue.intValue()); } } Here's the thread I'm using to call open this class: class PaymentThread extends Thread { Session sess = (Session)session(); public PaymentThread(String type) { super(type); } public void run() { PayReader pr = new PayReader(); pr.CashRead(pr,(Application)WOApplication.application(),sess); } } Thanks, Nathan On Dec 12, 2005, at 1:03 AM, Chuck Hill wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]
