groovy - Using Gaelyk URL routing in a non google app engine application -
i have groovy web application not being deployed on google app engine. (gae) have used gaelyk before , url routing functionality described in doc
how port on routing functionality gaelyk basic groovy web application not being deployed on gae?
note 1: not want use grails application.
note 2: dont mind including gaelyk jar rather not include gae.
if want implement in own non gae framework, best place start source...
to start with, you'll need class extends javax.servlet.filter in gaelyk, routesfilter class
as can see, in init
method of filter, calls loadroutes
loads routes.groovy script via groovyshell
.
this shell makes use of other classes in same package ends populating list<route> routes
property in filter instance of route class.
the filter (when configured web.xml) intercepts requests server checks uri against each route in turn (by calling foruri
method each route), , if match found, redirects or forwards required.
if no match found filter calls next filter down chain in web server's context.
hope answers question
Comments
Post a Comment