Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing Django URLs dispatching style in Servlets

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm considering creating my own Java web framework that mimics Django actions routing.
Django uses regular expressions for matching URLs with actions:

I don't have any code yet, just discussing things in my mind, here is my initial plan:
A Servlet filter is needed to intercept requests, this filter has a set of listed RegEx patterns. correct till now?

Lets say the application will have a big RegEx set, how to dispatch as fast as possible? it doesn't make sense to try to evaluate every RegEx in turn.
Thanks for help and time.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not much to do with servlets, so I'll move this to Performance.
 
jijun lx
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe the UrlRewriteFilter will help you partially .

http://code.google.com/p/urlrewritefilter/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic