Those get(){}, post(){}, etc things are method calls in the
constructor of your Servlet.
So if you have some route,action pairs in some external structure, you
could loop over them to declare them all.
e.g. something like
for (route <- routes) {
get(route.path){route.action}
}
What I've done in the past, as I was declaring consistent restful
actions for all the different resources like default Rails routes, was
something like
for (resource <- resources) {
get(
resource.name)( index(resource.Type) )
get(
resource.name + "/:id") ( renderTemplate( resource.Type,
param("id") )
post(
resource.name) { create new... }
put(
resource.name + "/:id")( update... )
}
-Leif Warner
On Mar 25, 2:55 am, Anton Onischenko <
anton.onishche...@gmail.com>
wrote: