From: Kirk Haines Date: 2004-08-20T05:12:46+09:00 Subject: Re: ANN: Iowa 0.9.1 Released On Fri, 20 Aug 2004 00:31:28 +0900, Michael Neumann wrote > > First, let's make sure I am answering the right question. You want to > > receive requests at /comment/FOO, where FOO can be anything. You want to > > then invoke some component with the value of FOO passed to it so that it can > > query the right set of comments to display, right? > > Exactly! Okay. In general, what you want to do is to setup a Main.iwa that is something like this class Main < Iowa::Component def setup comment_parameter = File.basename(session.context.request.request_uri) dispatch_page = page_named('YourComponent') dispatch_page.comment_parameter = comment_parameter dispatch_context = Iowa::Context.new(session.context.request, session.context.response) dispatch_context.sessionID = session.context.sessionID dispatch_context.requestID = session.requestCount dispatch_page.handleResponse(dispatch_context) session.currentPage = dispatch_page.dup end end What this does is takes the request and pulls the last part off of the path. It then creates an instance of the component that you actually want to have handle the current request, and passes that last bit of the path into a variable in that component. Then is passes the execution along. This is actually a common enough activity in my code that I really should provide a simple method for taking care of all of the exposed mechanics above. I'll make that a part of the next release. Give me a shout if I can help out further. Thanks, Kirk Haines