通信还是用httpservice
这和xmlhttp获得远端数据的方法是差不多的~
简单例子如下:
1。servlet
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("
");
out.println("This is my first Servlet");
out.println("");
out.println("Hello,World!
");
out.println("");
}
}
2。mxml
resultFormat="text"
method="POST"
contentType="application/xml">