protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException {

		try {
			resp.setContentType("text/plain");
			PrintWriter out = resp.getWriter();

			out.println("*** ApacheDS RootDSE ***\n");

			DirContext ctx = new InitialDirContext(this.createEnv());

			SearchControls ctls = new SearchControls();
			ctls.setReturningAttributes(new String[] { "*", "+" });
			ctls.setSearchScope(SearchControls.OBJECT_SCOPE);

			NamingEnumeration<SearchResult> result = ctx.search("",
					"(objectClass=*)", ctls);
			if (result.hasMore()) {
				SearchResult entry = result.next();
				Attributes as = entry.getAttributes();

				NamingEnumeration<String> ids = as.getIDs();
				while (ids.hasMore()) {
					String id = ids.next();
					Attribute attr = as.get(id);
					for (int i = 0; i < attr.size(); ++i) {
						out.println(id + ": " + attr.get(i));
					}
				}
			}
			ctx.close();

			out.flush();
		} catch (Exception e) {
			throw new ServletException(e);
		}
	}