setVariable will ony return strings, just turn the int into a string.

Try,

response.setVariable("fedex.statusCode", result.toString() );

or

String strResult = result.toString();
response.setVariable("fedex.statusCode", strResult );

-----Original Message-----
From: jon hall [mailto:[EMAIL PROTECTED]
Sent: 14 October 2003 16:35
To: CF-Talk
Subject: java cfx tag - returning integer variable

I'm having trouble setting an integer response variable in my cfx tag.
Here is the compiler error:

fedex.java:125: setVariable(java.lang.String,java.lang.String) in
com.allaire.cfx.Response
cannot be applied to (java.lang.String,int)
      response.setVariable("fedex.statusCode", result);

               
Here is the applicable code. If I change result to any string value it
compiles fine. I've even tried casting result to a string...no luck.

int result = httpclient.executeMethod(post);
response.setVariable("fedex.statusCode", result);
response.setVariable("fedex.response", post.getResponseBodyAsString());

Is it possible to return an integer value to CF?
--
jon
  mailto:[EMAIL PROTECTED]


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to