How to access html request parameters for a .rhtml page served by webrick?
问题 I'm using webrick (the built-in ruby webserver) to serve .rhtml files (html with ruby code embedded --like jsp). It works fine, but I can't figure out how to access parameters (e.g. http://localhost/mypage.rhtml?foo=bar) from within the ruby code in the .rhtml file. (Note that I'm not using the rails framework, only webrick + .rhtml files) Thanks 回答1: According to the source code of erbhandler it runs the rhtml files this way: Module.new.module_eval{ meta_vars = servlet_request.meta_vars