File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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: 3334

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 opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

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
 
 
subject: Implementing Django URLs dispatching style in Servlets
 
Threads others viewed
Generating Regular Expression at run-time
Help with String class
[Solved][HFSJ] Filter Preferences
Pno-:695 HFS&JSP Filter Sequence
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture