本文整理汇总了C++中HttpServletRequest::getRequestURI方法的典型用法代码示例。如果您正苦于以下问题:C++ HttpServletRequest::getRequestURI方法的具体用法?C++ HttpServletRequest::getRequestURI怎么用?C++ HttpServletRequest::getRequestURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpServletRequest
的用法示例。
在下文中一共展示了HttpServletRequest::getRequestURI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doGet
void FormTestServlet::doGet(HttpServletRequest& req, HttpServletResponse& resp)
{
ServletOutputStream& ostr = resp.getOutputStream();
ostr <<
"<html>\n"
"<head>\n"
"<title>POCO Form Server Sample</title>\n"
"</head>\n"
"<body>\n"
"<h1>POCO Form Server Sample</h1>\n"
"<h2>GET Form</h2>\n"
"<form method=\"GET\" action=\"/ServletTest/FormTestServlet\">\n"
"<input type=\"text\" name=\"text\" size=\"31\">\n"
"<input type=\"submit\" value=\"GET\">\n"
"</form>\n"
"<h2>POST Form</h2>\n"
"<form method=\"POST\" action=\"/ServletTest/FormTestServlet\">\n"
"<input type=\"text\" name=\"text\" size=\"31\">\n"
"<input type=\"submit\" value=\"POST\">\n"
"</form>\n";
ostr << "<h2>Request</h2><p>\n";
ostr << "Method: " << req.getMethod() << "<br>\n";
ostr << "URI: " << req.getRequestURI() << "<br>\n";
std::vector<std::string> names = req.getParameterNames();
std::vector<std::string>::iterator it = names.begin();
for(; it != names.end(); ++it)
ostr << *it << ":" << req.getParameter(*it);
ostr << "</p>";
ostr << "</body>\n";
}