我想在 doPost 方法中将 XML 请求从 JSP 发送到 Servlet。我怎样才能做到这一点。
这是在 JSP 页面中。
username = request.getParameter("username");
pasword = request.getParameter("password");
xml = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
+ "<login_credential><username>" + username + "</username>"
+ "<password>" + pasword + "</password></login_credential>";
这是在 Servlet 中。
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//HERE I want a xml which has sent from jsp page.
}