# ri > RDoc::Servlet

---
type: CommandReference
command: RDoc::Servlet
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference

- `server.mount '/', RDoc::Servlet` — mount the servlet at the root of a WEBrick server
- `server.mount '/rdoc', RDoc::Servlet, '/rdoc'` — mount at a non-root path (provide base path as third argument)
- `ri --server` — start ri documentation server (default port 8214)
- `gem server` — start RubyGems documentation server (default port 8808)

## Name

`RDoc::Servlet` — a WEBrick servlet that allows browsing ri documentation.

## Synopsis

This class inherits from `WEBrick::HTTPServlet::AbstractServlet`. Use it to serve RDoc documentation via a WEBrick server.

ruby
require 'webrick'

server = WEBrick::HTTPServer.new Port: 8000
server.mount '/', RDoc::Servlet
If mounting at a path other than the root, provide the base path:

ruby
server.mount '/rdoc', RDoc::Servlet, '/rdoc'
## Class Methods

- `new` — creates a new servlet instance.

## Instance Methods

- `asset` — serves static assets (e.g., CSS, JavaScript).
- `asset_dirs` — returns directories containing assets.
- `do_GET` — handles GET requests.
- `documentation_page` — renders a documentation page for a given class/module.
- `documentation_search` — performs a search across documentation.
- `documentation_source` — returns the source of documentation (e.g., RDoc::Store).
- `error` — handles errors (e.g., 404, 500).
- `generator_for` — returns the appropriate generator for a given class/module.
- `if_modified_since` — checks HTTP `If-Modified-Since` header.
- `installed_docs` — list of installed RDoc stores.
- `not_found` — renders a 404 page.
- `options` — returns the options hash.
- `ri_paths` — returns the list of ri documentation paths.
- `root` — renders the root index page.
- `root_search` — handles search on the root page.
- `show_documentation` — displays documentation for a given item.
- `store_for` — returns the RDoc::Store for a given path.

## Attributes

- `asset_dirs` — (read-only) list of directories containing static assets.
- `options` — (read-only) the options hash used to configure the servlet.

## See Also

- [WEBrick::HTTPServer](http://localhost/phpMan.php/perldoc/WEBrick%3A%3AHTTPServer/markdown)
- [WEBrick::HTTPServlet::AbstractServlet](http://localhost/phpMan.php/perldoc/WEBrick%3A%3AHTTPServlet%3A%3AAbstractServlet/markdown)