@Override
	protected void process(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// 存储KV
		if (req.getPathInfo().equals("/put")) {
			kvs.set(req.getParameter("k"), req.getParameter("v"));
			resp.getWriter().write(req.getParameter("v"));
			return;
		}
		// 得到KV
		if (req.getPathInfo().equals("/get")) {
			resp.getWriter().write(kvs.get(req.getParameter("k")));
			return;
		}
		// 获取七牛的新建文件token
		if (req.getPathInfo().equals("/key")) {
			resp.getWriter().write(qns.uptoken(req.getParameter("bucket")));
			return;
		}
		// 定向服务
		if (req.getPathInfo().startsWith("/red")) {
			String path = req.getPathInfo().replaceFirst("\\/red", "");
			String vers = kvs.get(path);
			if (!vers.equals("")) {
				vers = "." + vers;
			}
			if (req.getQueryString() != null) {
				vers += "?" + req.getQueryString();
			}
			resp.sendRedirect("http://zhangbo7364.u.qiniudn.com" + path + vers);
			return;
		}
		// 脚本服务
		if (req.getPathInfo().startsWith("/scr")) {
			String path = req.getPathInfo().replaceFirst("\\/scr", "");
			Engine e = getEngine(this.getInitParameter("path"));
			e.eval("var a = '"+path+"';");
			resp.getWriter().write(e.get("a").toString());
			return;
		}
	}