In order to see what happens with the different settings assigned to a mapping, let's check that our current mapping is as follows:
We have /api
as our virtual name. We are pointing to our {system-directory}/components/cfcs
folder and we are using an Archive that was set up for us by Railo Server. Our Primary mapping is set to Resource, while Inspect is set to Always.
1. Let's change the code in our
Main.cfc
component and add a new function; let's edit the component that's in our<Railo Install Directory>/components/api/Main.cfc
and add the following:component output="false"{ public function reverseIt(String input){ return Reverse(input); } public function getFirstLetter(String input){ return left(input, 1); } }
2. Now let's add another line to the template named
listing_8_07.cfm
to call this function and add the following code:<cfset Main = new api.Main()> <cfoutput>#Main.reverseIt("Check out my reverse!")#</cfoutput...