Thanks Dave, I was kinda thinking the same thing... you just saved me some work!

Darren




>> I have files in a subdir under an application.cfc.
>> 
>> I'd like to automatically append a specific myvar=somevalue 
>> to every hyperlink on these pages. Is there a way I can use 
>> onRequest and regular expressions to re-write paths before 
>> they're output back to the browser?
>
>Yes, you can. You'd have something like this:
>
><cffunction name="onRequest">
>       <cfargument name="targetPage">
>       <cfsavecontent var="page">
>               <cfinclude template="#Arguments.targetPage#">
>       </cfsavecontent>
>       <!--- your regex stuff goes here --->
>       <cfoutput>#page#</cfoutput>
></cffunction>
>
>Alternatively, you could append data to links with JavaScript. This is very
>easy to do, since all the links are in the document.links array. This would
>perform better, but would obviously only work for clients that have
>JavaScript enabled.
>
>> In case you're wondering why, I'm following Philip Chalmers 
>> suggestion (http://coldfusion.sys-con.com/node/41749) about 
>> adding random numbers to url params and form actions so proxy 
>> servers never cache dynamic pages.
>
>I don't recommend you do this, actually. While it may have been a problem in
>2002 when that article was written, it really isn't a common problem today.
>For that matter, I don't think it was all that common a problem in 2002. But
>anyway, nowadays, proxy servers tend to be well-behaved; if you don't want a
>file to be cached, there are all sorts of META tags you can embed in the
>page to instruct proxies.
>
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>
>Fig Leaf Software provides the highest caliber vendor-authorized
>instruction at our training centers in Washington DC, Atlanta,
>Chicago, Baltimore, Northern Virginia, or on-site at your location.
>Visit http://training.figleaf.com/ for more information! 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312134
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to