Ticket #350 (closed task: fixed)

Opened 3 months ago

Last modified 2 months ago

SES interceptor - Custom routes can now distinguish between numeric and alphanumeric placeholders just add :varname-numeric

Reported by: sullah Assigned to: lmajano
Priority: high Milestone: 2.6.0
Component: Interceptors - SES Version: 2.5.2
Severity: normal Keywords: SES
Cc:

Description (Last modified by lmajano)

SES interceptor - Custom routes can now distinguish between numeric and alphanumeric placeholders just add :varname-numeric

Example: /entry/:year-numeric/:month/:day-numeric

Month will be alphanumeric.

Change History

03/17/08 12:33:54 changed by lmajano

  • priority changed from normal to high.
  • status changed from new to assigned.
  • version changed from 2.5.1 to 2.5.2.
  • description changed.
  • severity changed from minor to normal.

This is an interesting one I have found an interesting way to go about it. A custom route is defined by adding a variable placeholder with :varname. There are two types of variables we can check for:

  1. alphanumeric
  2. numeric.

The default will be alphanumeric, no need to add anything to the variable, just declare it in the same way. However, for numeric patterns a simple pattern can be placed:

route="/myroute/:id-numeric"

This will tell the routing engine that id has to be numeric. Else, its not a route match. So if you need a numeric variable, the easiest way will be to add a -numeric tag to the variable name. This feature will enhance the routing system and make it even more flexible.

03/19/08 02:35:39 changed by lmajano

  • status changed from assigned to closed.
  • resolution set to fixed.
  • description changed.
  • summary changed from SES detect Numbers,Strings to SES interceptor - Custom routes can now distinguish between numeric and alphanumeric placeholders just add :varname-numeric.

Copyright 2006 ColdBox Framework by Luis Majano