aspose file tools
The moose likes Performance and the fly likes Implementing Django URLs dispatching style in Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Performance
Reply 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: 3359

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: 56233
    
  13

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

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Implementing Django URLs dispatching style in Servlets
 
Similar Threads
Help with String class
Generating Regular Expression at run-time
[Solved][HFSJ] Filter Preferences
Pno-:695 HFS&JSP Filter Sequence