# File lib/cgikit/handler.rb, line 374
    def url( context, path = nil, query = {}, is_secure = false,
             port = 80, sid = true )
      str = application_url(context.request, is_secure, port)
      str << "/#{request_handler_key()}"
      str << "/#{path}" if path
      if sid and context.has_session? then
        query[@application.direct_action_session_key] = context.session.session_id
      end
      qstr = query_string(query)
      unless qstr.empty? then
        str << "?#{qstr}"
      end
      str
    end