Request Path MappingGoals:
Non-Goals:
ImplementationAt the lowest level, Helma 2 will employ pluggable RequestMappers to map incoming requests to objects and actions. For example, a HopObjectRequestMapper will start at the HopObject root element, sequentially get the child element for each path element and try to resolve the last element to an action. Alternatively, there might be something like a PlainScriptFileRequestMapper that tries to resolve the request path to a JS script file in the server's document root, create a JS object from the script file and invoke an action on it. This would provide a means to use Helma without persistent objects in a way that resembles classic web scripting systems such as PHP. In fact, this is exactly what the current Helma 2 Subversion snapshot does. Additionally, RequestMappers may support partial path mapping, including the processing of remaining request path elements in a way similar to what Ruby on Rails does. Note how Jürg's implementation has to run circles to come around the limitions of getChildElement(). We probably want a more powerful method than that for this purpose, one which is able to process the whole remaining request path as an array in one single call. I'm not sure we want controller/handler object mapping to be part of partial path mapping, as it seems a bit cumbersome after all. Maybe the best of both worlds is to use simple child element lookup for getting at the handler object, and then just convert remaining path elements to parameters as specified by the handler object. In other words, the basic mapping algorithm (implemented by each RequestMapper independently, or by one common base class) would be:
This is more or less a generalization of what Helma 1 does, as it allows handler objects to resolve several unmapped path elements to actions with parameters, instead of just mapping one last path element to an action, and it gives the RequestMapper and/or handler object greater freedom on how to implement this. Pages linking to this page: Helma 1 Compatibility Layer |
navigation
Download
Community
Weblog
Mailing Lists
IRC Channel
Documentation
Introductions
Tools
Reference
Project
Roadmap
Bug Reporting
Source
Helma NG Wiki
Wiki
Tags
Updates
Related Projects
Sites using Helma
Shop
search
tags for this page
all tags
Tagsapps (1) bugs (2) class (1) community (2) compatibility (1) concurrency (1) continuations (2) Documentation (6) dogfood (1) formatting (1) functions (1) gobi (1) helma (7) helma 1.6 (13) helma 1.7 (8) helma 1.x (1) helma 2 (11) helma ng (18) hopobject (1) howto sample code xml-rpc (1) html (1) inheritance (5) introspection (1) java (3) javascript (5) jetty (1) JSDoc (1) lazy (1) marius person (1) metaprogramming (2) modules (3) oop (1) organization (2) ORM (2) parsing (1) plugins (1) project (2) projects (1) prototype (2) prototype scope rhino functions this (0) Rabbit (2) Reference (1) REPL (1) rhino (5) roadmap (3) scope (1) shell (1) shop (0) Skin Rendering (5) Snippets (1) source svn (1) sugar (3) templates (13) testing (4) this (1) Tobi (7) xml (1) Pages linking to this page: Wiki Overview Text Draft, wiki pages linking here
|