P
Peter Judge
Guest
This last one because I said the /ping is handled by my PingWebHandler class. But I can say that /foo is handled by my PingWebHandler as well. In that case the PathInfo would be /foo/bla/bla2. To make things generic I'm not interesting in either the /ping of /foo part (this can be anything since it's a configuration thing), but in the /bla/bla2 part. Right now the unexpanded handler pattern/string is not available in the WebHandler. I had a quick chat with the developers and they say that it's feasible to make this info available (so add an idea or a bug). The way I'd probably do it today would be to have an (abstract) type that does the work, and n derived handlers that knew which URL pattern they were responsible for handling. Something like the pseudo-stuff below. Class GeneralHandler abstract Def prop URLPattern as char . Method handleget(). Case this-object:URLPattern: When '/ping' then ... End method. End class. Class PingHandler inherits GeneralHandler Ctor PingHandler() This-object:URLPattern = '/ping'. End class. Class PongHandler inherits GeneralHandler Ctor PongHandler() This-object:URLPattern = '/pong'. End class. Openedge.properties handler1=PingHandler: /ping/{FirstToken}/slug/etc handler1=PongHandler: /pong/{FirstToken}/slug/etc
Continue reading...
Continue reading...