JSP这样写
<%@ page contentType="text/xml" %>
<?xml version="1.0"?>
      <SOAP:Envelope xmlns:SOAP="urn:schemas-xmlsoap-org:soap.v1">
          <SOAP:Header></SOAP:Header>
          <SOAP:Body>
              <m:GetTime xmlns:m="urn:myserver/soap:gettime">
                  <time><%=new java.util.Date()%>,<%=request.getReader()%></time>
              </m:GetTime>
          </SOAP:Body>
      </SOAP:Envelope>

解决方案 »

  1.   

    e.g.
    <%@ page contentType="text/html; charset=GBK" %>
    <html>
    <head>
    <meta http-equiv="pragma" content="no-cache">
    </head>
    <body>
    <%
      if(request.getParameter("testc")!=null){
        try{
          javax.servlet.ServletInputStream in = request.getInputStream();
          int c = in.read();
          byte []b=new byte[1000];
          int len = 0;
          while(c!=-1){
            b[len] = (byte)c;
            len++;
            c = in.read();
          }
          String str = new String(b,0,len);
      str=new String(str.getBytes("GBK"),"UTF-8");
          out.println(str);
        }catch(Exception e){
          out.println(e.getMessage());
        }
      }
    %><div id="divDisplay">The response will be put in here</div>
        <input type="button" onclick="sendData();" value="Send it!">
        <script> 
        function sendData(){
            var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            xmlhttp.Open("POST", "t.jsp?testc=23;34;", false);
            xmlhttp.Send("中文");
            alert(xmlhttp.responseText);
        }
        </script>
    </body>
    </html>
      

  2.   

    xsl中怎样使用JAVASCRIPT
    xsl中怎样应用外部JAVASCRIPT,如common.js
      

  3.   

    其实生成xml最重要的是用<%@ page contentType="text/xml; charset=UTF-8" %>
    设定文档类型然后剩下的就是你用rs去循环生成tag的过程了