Thanks Dave, I did think about using <cferror type="exception">, was wondering if that was compatible under CF 5

  ----- Original Message -----
  From: Dave Watts
  To: CF-Talk
  Sent: Friday, July 16, 2004 1:35 PM
  Subject: RE: solutions for code resuse inside the <cferror> tags ...

  > When setting the error types to "validation" and "request"
  > what options are there as far as code reuse are available?
  >
  > What solutions or workarounds are out there?

  I'm not sure exactly what you mean by code reuse in this context. When you
  specify an error page using CFERROR with types VALIDATION or REQUEST, those
  pages can't have any server-side code in them. However, they can be invoked
  by any page within your application that encounters those error types.

  You can also use client-side code in those pages, such as _javascript_. Years
  ago, we used to use _javascript_ to capture error variables and redirect the
  error to another server-side script which could then do something with that
  error data. Of course, this is a relatively fragile thing to implement, and
  we don't bother with that sort of thing any more.

  Nowadays, if you want to execute server-side code in response to an error,
  use TYPE="EXCEPTION" and/or the site-wide error handler. The REQUEST error
  page should be the error handler of last resort, only being used if all your
  other error handlers have failed. The VALIDATION error page should only be
  used if you're using the built-in server-side validation rules, which I
  would recommend that you not use in any case - it's not really server-side
  validation, and isn't reliable for validation for security's sake.

  Dave Watts, CTO, Fig Leaf Software
  http://www.figleaf.com/
  phone: 202-797-5496
  fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to