Skip to content

Instantly share code, notes, and snippets.

@pmahoney
Created August 28, 2012 20:32
Show Gist options
  • Save pmahoney/3503878 to your computer and use it in GitHub Desktop.
Save pmahoney/3503878 to your computer and use it in GitHub Desktop.
Ruby Servlet impl skeleton
# Implements some part of the Servlet API in Ruby. Does not extend
# javax.servlet.http.HttpServlet, but implements javax.servlet.Servlet
class MyServlet
include Java::JavaxServlet::Servlet
# @param [javax.servlet.ServletConfig] servletConfig
def init(servletConfig)
end
def destroy
# no-op
end
def to_s
"#<#{self.class}>"
end
alias :servlet_info :to_s
# @param [javax.servlet.ServletRequest] req a Java servlet request
#
# @param [javax.servlet.ServletResponse] resp a Java servlet response
def service(req, resp)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment