Think about what the code is doing for a second :) It is still trying to pass 
in all strings instead of a mix of strings and complex objects. 

It may not seem like it, but using a java method is not much different than 
calling a plain old CF function. Both define what arguments they expect as well 
the type (array, date, string, etcetera).

Take the CF function arrayLen(). It expects to receive an array and complains 
loudly if you accidentally pass in the wrong type of value, like a string or 
number: 

       <cfset x = arrayLen("thisWillFail")>

That is what your current code is doing. It is passing in the right +number+ of 
arguments. They are just the wrong "type" of values.

>>  sendResponse(javax.servlet.ServletContext, ....)

sendReponse expects a javax.servlet.ServletContext object as the first 
argument. Do a cfdump of getPageContext().getServletContext(). You will see 
that is exactly what it returns. But instead of passing it in as is, the code 
tries to convert it into string first:

    JavaCast("string", getPageContext().getServletContext() )

Obviously that does work because your method exepcts a ServletContext object 
there, not a string. So get rid of the javacast. In fact get rid of all of 
them. I doubt you even need them to call this particular method.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:346864
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to