It's not a secret anymore!*
The moose likes Performance and the fly likes Implementing Django URLs dispatching style in Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Implementing Django URLs dispatching style in Servlets" Watch "Implementing Django URLs dispatching style in Servlets" New topic
Author

Implementing Django URLs dispatching style in Servlets

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

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

Joined: Jan 10, 2002
Posts: 61095
    
  66

Not much to do with servlets, so I'll move this to Performance.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jijun lx
Greenhorn

Joined: Jul 12, 2011
Posts: 4
maybe the UrlRewriteFilter will help you partially .

http://code.google.com/p/urlrewritefilter/

------
Best regards
Jijun
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implementing Django URLs dispatching style in Servlets