servlet获取不到http的请求体
问题如下:要做一个jsp调用servlet,其中jsp中包含字符串化的xml,xmlstr='....',在servlet中要获得这个字符串话的xml。在jsp
<%@ page language="java" pageEncoding="gbk"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<a href="http://localhost:8080/aa/servlet/test?sessionid=123456">This is my JSP page.</a>
<%String originalXML="";
StringBuffer str=new StringBuffer();
str.append("<?xml version = \"1.0\" ?>");
str.append("<SSOMessage><SSOParas><ESMPID>123455</ESMPID>");
str.append("<SubID>13904813692</SubID><UserID>00</UserID>");
str.append("<EchoURL>www.sina.com</EchoURL><Timeout>400</Timeout>");
str.append("<TimeStamp>080220094512</TimeStamp></SSOParas></SSOMessage>");
%>
xmlstr=<%=originalXML%>
</body>
</html
调用的servlet:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
BufferedReader str=null;
str=request.getReader();
StringBuffer ss=new StringBuffer();
String s="";
while((s = str.readLine()) != null){
ss.append(s);
}
out.print(ss.toString());
out.flush();
}
现在运行的结果是什么也取不到xmlstr内容,不知道哪里出了问题,请知道的指点一下,不胜感激