> Unfortunately, the getHeaders method is throwing a method 
> selection exception...it's definitely there though. Anyone 
> know what I am missing?

The getHeaders() method takes a String parameter.  Check out the code
below (watch wrap) to see.  This is basically a take-off of CFDUMP that
uses the Java Reflection API to introspect a particular object and find
out information about it, namely any superclasses, contructors, field
names and methods (including return type and required parameters).
Unfortunately it doesn't tell you what the params are for, just their
type!

<!--- ----------------------------------------------------- --->

<!--- get an instance of the object we want to look at --->
<cfset cl = GetPageContext()>
<cfset cl = cl.getRequest()>

<!--- get the class type for the given object --->
<cfset c = cl.getClass()>
<!--- get immediate superclass --->
<cfset superclass = c.getSuperclass()>
<!--- get the contructors --->
<cfset constructors = c.getConstructors()>
<!--- get the field names --->
<cfset fields = c.getFields()>
<!--- get the methods --->
<cfset methods = c.getMethods()>

<!--- print out all methods, return types + param types --->
<cfoutput>
  <h2>Object Type : #c#</h2>

  <h3>Superclass</h3>
  <cfscript>
     keepgoing = TRUE;
     while (keepgoing) {
         if (isdefined("superclass")) {
             writeoutput("#superclass.getName()#<br>");
             superclass = superclass.getSuperclass();
         } else {
             keepgoing = FALSE;
         }
     }
  </cfscript>

  <h3>Contructors</h3>
  <cfloop index="i" from="1" to="#arraylen(constructors)#">
    #c.getName()# (
    <cfset params = constructors[i].getParameterTypes()>
    <cfloop index="x" from="1" to="#arraylen(params)#">
        #params[x].getName()#
    </cfloop>
    )<br>
  </cfloop>

  <h3>Field Names</h3>
  <cfloop index="i" from="1" to="#arraylen(fields)#">
    <cfset type = fields[i].getType()>
    #fields[i].getName()# (#type.getName()#)<br>
  </cfloop>

  <h3>Methods</h3>
  <cfloop index="i" from="1" to="#arraylen(methods)#">
    Method : <b>#methods[i].getName()#</b><br>
    &nbsp; &nbsp; &nbsp; &nbsp; <i>Returns :
#methods[i].getReturnType().getName()#</i><br>
    <cfset params = methods[i].getParameterTypes()>
    <cfloop index="x" from="1" to="#arraylen(params)#">
        &nbsp; &nbsp; &nbsp; &nbsp; Param : #params[x].getName()#<br>
    </cfloop>
    <br>
  </cfloop>
</cfoutput>

<!--- ----------------------------------------------------- --->

Before you ask, yes I was bored.  :o)

Maybe a bit more than you asked for, but hey, someone might find it
useful...

Tim.


-------------------------------------------------------
OUR NEW SITE IS NOW LIVE
Visit our new website at http://www.rawnet.com/ and
race around the beautiful Bracknell streets at
http://xmas.rawnet.com/
-------------------------------------------------------
Tim Blair
Web Application Engineer, Rawnet Limited
Direct Phone : +44 (0) 1344 393 441
Switchboard : +44 (0) 1344 393 040
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to