Allow developers using SES to declare routes in their event handlers. Allow for a handler-level route, or for action-level routes. Take into consideration all the parameters to addRoute that make sense in this context such as HTTP verbs to match, constraints, pattern, ssl, etcfor handlers but also for actions themselves like this
Example handler Implementation:
The following URLs would all work:
Default SES behavior
With in-handler routes:
example.com/index.cfm/prod --> services.companyProducts.index
example.com/index.cfm/prod/main --> services.companyProducts.index
example.com/index.cfm/prod/list --> services.companyProducts.listProducts
I was thinking of creating a module to do just this. If it's going to be in the core, I'm happy to work on this.
Proposal: Should the default behavior also work if you add in-handler routes? I don't think so. I think when you define a route in the handler annotation, it should override the default behavior. It would clear up confusion about which URL to use. If there are concerns of backward compatibility or other forwarding issues, perhaps we provide a 'redirectConventialRoute' annotation (or some other clever name) that defaults to 'true' and does a 301 Moved Permanently redirect. If the flag is set to false, then both URLs would work.
I think we can start it as an incubation module and if it merits, then bake it into the core.